Created
November 29, 2018 00:17
-
-
Save Ksisu/e52423bece2b1d547c23ce26921a2a7e to your computer and use it in GitHub Desktop.
SQL Server log filebeat logstash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- type: log | |
enabled: true | |
paths: | |
- /data/mssql2017/log/errorlog | |
multiline: | |
pattern: '^\t' | |
negate: false | |
match: after | |
fields: | |
log_type: mssql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
beats { | |
port => "5044" | |
} | |
} | |
filter { | |
if [fields][log_type] == "mssql" { | |
grok { | |
match => { | |
"message" => [ "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:logsource}%{SPACE}%{GREEDYDATA:message}" ] | |
} | |
"overwrite" => "message" | |
} | |
date { | |
match => [ "timestamp", ISO8601 ] | |
} | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => [ "elasticsearch:9200" ] | |
manage_template => false | |
index => "filebeat-%{[fields][log_type]}-%{+YYYY.MM.dd}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment