Skip to content

Commit

Permalink
adjust more things again
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch committed Nov 19, 2021
1 parent d68d4d5 commit 2ff01b3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion winlogbeat/tests/system/test_wineventlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_resume_reading_events(self):
# remove the output file, otherwise there is a race condition
# in read_events() below where it reads the results of the previous
# execution
os.unlink(os.path.join(self.working_dir, "output", self.beat_name))
os.unlink(os.path.join(self.working_dir, "output", self.beat_name + "-" + self.today + ".ndjson"))

msg = "Second event"
self.write_event_log(msg)
Expand Down
6 changes: 2 additions & 4 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,8 @@ func (o *Operator) getMonitoringFilebeatConfig(outputType string, output interfa
},
},
"paths": []string{
filepath.Join(paths.Home(), "logs", "elastic-agent-json.log"),
filepath.Join(paths.Home(), "logs", "elastic-agent-json.log*"),
filepath.Join(paths.Home(), "logs", "elastic-agent-watcher-json.log"),
filepath.Join(paths.Home(), "logs", "elastic-agent-watcher-json.log*"),
filepath.Join(paths.Home(), "logs", "elastic-agent-*.ndjson"),
filepath.Join(paths.Home(), "logs", "elastic-agent-watcher-*.ndjson"),
},
"index": fmt.Sprintf("logs-elastic_agent-%s", monitoringNamespace),
"processors": []map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func makeInternalFileOutput(cfg *Config) (zapcore.Core, error) {
// defaultCfg is used to set the defaults for the file rotation of the internal logging
// these settings cannot be changed by a user configuration
defaultCfg := logp.DefaultConfig(logp.DefaultEnvironment)
filename := filepath.Join(paths.Home(), "logs", fmt.Sprintf("%s-json.log", cfg.Beat))
filename := filepath.Join(paths.Home(), "logs", cfg.Beat)

rotator, err := file.NewFileRotator(filename,
file.MaxSizeBytes(defaultCfg.Files.MaxSize),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (b *Monitor) EnrichArgs(spec program.Spec, pipelineID string, args []string
if isSidecar {
logFile += "_monitor"
}
logFile = fmt.Sprintf("%s-json.log", logFile)
logFile = fmt.Sprintf("%s", logFile)
appendix = append(appendix,
"-E", "logging.files.path="+loggingPath,
"-E", "logging.files.name="+logFile,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/elastic-agent/pkg/core/monitoring/beats/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (

const (
// args: data path, pipeline name, application name
logFileFormat = "%s/logs/%s/%s-json.log"
logFileFormat = "%s/logs/%s/%s"
// args: data path, install path, pipeline name, application name
logFileFormatWin = "%s\\logs\\%s\\%s-json.log"
logFileFormatWin = "%s\\logs\\%s\\%s"

// args: pipeline name, application name
mbEndpointFileFormatWin = `npipe:///%s-%s`
Expand Down

0 comments on commit 2ff01b3

Please sign in to comment.