Skip to content

Commit

Permalink
Enhance Suricata pipeline to handle destination.domain being set (#10861
Browse files Browse the repository at this point in the history
)

This replaces the usage of a `rename` processor with an `append` + `remove` processor.
Then a script processor is used to deduplicate the domains.

Fixes #10510
  • Loading branch information
andrewkroh authored Feb 26, 2019
1 parent 40047ed commit 5ef730f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add Netflow module to enrich flow events with geoip data. {pull}10877[10877]
- Set `event.category: network_traffic` for Suricata. {pull}10882[10882]
- Add configuration knob for auto-discover hints to control whether log harvesting is enabled for the pod/container. {issue}10811[10811] {pull}10911[10911]
- Change Suricata module pipeline to handle `destination.domain` being set if a reverse DNS processor is used. {issue}10510[10510]

*Heartbeat*

Expand Down
19 changes: 16 additions & 3 deletions x-pack/filebeat/module/suricata/eve/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,23 @@
}
},
{
"rename": {
"append": {
"if": "ctx.suricata?.eve?.http?.hostname != null",
"value": "{{suricata.eve.http.hostname}}",
"field": "destination.domain"
}
},
{
"remove": {
"field": "suricata.eve.http.hostname",
"target_field": "destination.domain",
"ignore_missing": true
"ignore_failure": true
}
},
{
"script": {
"type": "painless",
"source": "def domain = ctx.destination?.domain; if (domain instanceof Collection) { domain = domain.stream().distinct().collect(Collectors.toList()); if (domain.length == 1) { domain = domain[0]; }ctx.destination.domain = domain; }",
"ignore_failure": true
}
},
{
Expand Down

0 comments on commit 5ef730f

Please sign in to comment.