Skip to content

Commit

Permalink
adding support for epoch in seconds (elastic#19512)
Browse files Browse the repository at this point in the history
What does this PR do?

Certain versions of fortinet handles the eventtime field in seconds instead of milliseconds, added support for that datetime format
Why is it important?

Adds support for certain fields that can be calculated incorrectly on certain versions.
  • Loading branch information
P1llus authored Jul 14, 2020
1 parent fead071 commit f367f79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 15 additions & 2 deletions x-pack/filebeat/module/fortinet/firewall/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,26 @@ processors:
formats:
- UNIX_MS
timezone: "{{fortinet.firewall.tz}}"
if: "ctx.fortinet?.firewall?.tz != null"
if: "ctx.fortinet?.firewall?.tz != null && (ctx.fortinet?.firewall?.eventtime).length() > 11"
- date:
field: fortinet.firewall.eventtime
target_field: event.start
formats:
- UNIX
timezone: "{{fortinet.firewall.tz}}"
if: "ctx.fortinet?.firewall?.tz != null && (ctx.fortinet?.firewall?.eventtime).length() <= 11"
- date:
field: fortinet.firewall.eventtime
target_field: event.start
formats:
- UNIX_MS
if: "ctx.fortinet?.firewall?.tz == null"
if: "ctx.fortinet?.firewall?.tz == null && (ctx.fortinet?.firewall?.eventtime).length() > 11"
- date:
field: fortinet.firewall.eventtime
target_field: event.start
formats:
- UNIX
if: "ctx.fortinet?.firewall?.tz == null && (ctx.fortinet?.firewall?.eventtime).length() <= 11"
- rename:
field: fortinet.firewall.devname
target_field: observer.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"event.kind": "event",
"event.module": "fortinet",
"event.outcome": "success",
"event.start": "1970-01-19T10:29:21.368Z",
"event.start": "2020-06-24T01:16:08.000Z",
"event.timezone": "-02:00",
"event.type": [
"connection",
Expand Down Expand Up @@ -313,7 +313,7 @@
"event.kind": "event",
"event.module": "fortinet",
"event.outcome": "success",
"event.start": "1970-01-19T06:09:48.391-04:00",
"event.start": "2020-06-10T07:26:31.000-04:00",
"event.timezone": "-0400",
"event.type": [
"allowed"
Expand Down

0 comments on commit f367f79

Please sign in to comment.