Skip to content

Commit

Permalink
added timestamp_fields configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
darvid committed Aug 24, 2017
1 parent 262e9e5 commit a8b3b1d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions beater/nessusbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ func (bt *Nessusbeat) Run(b *beat.Beat) error {
"see_also": record[11],
"plugin_output": record[12],
}
timestampFields := strings.Split(bt.config.TimestampFields, ",")
for _, field := range timestampFields {
event[strings.TrimSpace(field)] = event["@timestamp"]
}
bt.client.PublishEvent(event)
}
}
Expand Down
7 changes: 4 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
package config

type Config struct {
CaCertPath string `config:"cacert_path"`
CaCertPath string `config:"cacert_path"`
ReportPath string `config:"report_path"`
NessusApiUrl string `config:"api_url"`
NessusApiUsername string `config:"api_username"`
NessusApiPassword string `config:"api_password"`
TimestampFields string `config:"timestamp_fields"`
}

var DefaultConfig = Config{
ReportPath: "/opt/nessus/var/nessus/users/admin/reports",
NessusApiUrl: "https://localhost:8834",
ReportPath: "/opt/nessus/var/nessus/users/admin/reports",
NessusApiUrl: "https://localhost:8834",
}
1 change: 1 addition & 0 deletions nessusbeat.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nessusbeat:
#api_url:
#api_username:
#api_password:
#timestamp_fields:

name: nessusbeat

Expand Down
1 change: 1 addition & 0 deletions nessusbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nessusbeat:
#api_url:
#api_username:
#api_password:
#timestamp_fields:

name: nessusbeat

Expand Down

0 comments on commit a8b3b1d

Please sign in to comment.