Skip to content

Commit

Permalink
convert mssql pipeline from json to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
leehinman committed Mar 31, 2020
1 parent b70e44b commit 8486777
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 59 deletions.
58 changes: 0 additions & 58 deletions x-pack/filebeat/module/mssql/log/ingest/pipeline.json

This file was deleted.

41 changes: 41 additions & 0 deletions x-pack/filebeat/module/mssql/log/ingest/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
description: Pipeline to parse MSSQL logs
processors:
- grok:
field: message
patterns:
- '%{MSSQL_DATE:date} %{DATA:mssql.log.origin} [ ]*%{GREEDYDATA:msg_temp}'
pattern_definitions:
MSSQL_DATE: '%{DATA} %{DATA}'
- date:
if: ctx.event.timezone == null
field: date
formats:
- yyyy-MM-dd HH:mm:ss.SS
on_failure:
- append:
field: error.message
value: '{{ _ingest.on_failure_message }}'
- date:
if: ctx.event.timezone != null
field: date
formats:
- yyyy-MM-dd HH:mm:ss.SS
timezone: '{{ event.timezone }}'
on_failure:
- append:
field: error.message
value: '{{ _ingest.on_failure_message }}'
- remove:
field: date
ignore_missing: true
- rename:
field: message
target_field: log.original
- rename:
field: msg_temp
target_field: message
ignore_missing: true
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/mssql/log/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ var:
os.linux:
- /var/opt/mssql/log/error*

ingest_pipeline: ingest/pipeline.json
ingest_pipeline: ingest/pipeline.yml
input: config/config.yml

0 comments on commit 8486777

Please sign in to comment.