Skip to content

Commit

Permalink
Parse url based on threat subtype
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Nov 18, 2020
1 parent 9513b9f commit 0d6e145
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 300 deletions.
27 changes: 22 additions & 5 deletions x-pack/filebeat/module/panw/panos/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,13 @@ processors:
value: "{{panw.panos.ruleset}}"
ignore_empty_value: true

# Set url values
# Set url and file values
- rename:
if: 'ctx?.panw?.panos?.sub_type != "url"'
field: url.original
target_field: file.name
ignore_missing: true

- grok:
field: url.original
patterns:
Expand All @@ -460,16 +466,27 @@ processors:
PATH: '[^\?#]*'
QUERY: '[^#]*'
ANY: '.*'
if: 'ctx?.url?.original != null && ctx?.url?.original != "-/"'
if: 'ctx?.url?.original != null && ctx?.url?.original != "-/" && ctx?.url?.original != ""'

- grok:
field: url.path
patterns:
- '%{FILENAME}(\.%{ANY:url.extension})?'
- '%{FILENAME}((?:\.%{ANY})*(\.%{ANY:url.extension}))?'
ignore_missing: true
pattern_definitions:
FILENAME: '[^\.]+'
ANY: '.*'
if: 'ctx?.url?.path != null && ctx?.url?.path != ""'

- grok:
field: file.name
patterns:
- '%{FILENAME}((?:\.%{ANY})*(\.%{ANY:file.extension}))?'
ignore_missing: true
pattern_definitions:
FILENAME: '[^\.]*'
FILENAME: '[^\.]+'
ANY: '.*'
if: 'ctx?.url?.path != null'
if: 'ctx?.file?.name != null && ctx?.file?.name != ""'

- append:
field: related.user
Expand Down
Loading

0 comments on commit 0d6e145

Please sign in to comment.