Created
March 25, 2019 23:31
-
-
Save linuxmalaysia/7957448925b72bd05558966a6534f95f to your computer and use it in GitHub Desktop.
Logstash Grok Pattern for Bind9 input using Filebeat
This file contains 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
### Logstash Grok Pattern for Bind9 input using Filebeat | |
%{BIND9_TIMESTAMP:timestamp}%{SPACE}%{LOGLEVEL:loglevel}:%{SPACE}client%{SPACE}%{IP:clientip}#%{POSINT:clientport}%{SPACE}\(%{DATA:query}\):%{SPACE}view%{SPACE}internal:%{SPACE}query:%{SPACE}%{DATA:query2} %{DATA:queryclass} %{DATA:querytype} %{DATA:queryflag} \(%{IP:dnsip}\) | |
#### | |
grok { | |
match => { | |
"message" => [ "%{BIND9_TIMESTAMP:timestamp}%{SPACE}%{LOGLEVEL:loglevel}:%{SPACE}client%{SPACE}%{IP:clientip}#%{POSINT:clientport}%{SPACE}\(%{DATA:query}\):%{SPACE}view%{SPACE}internal:%{SPACE}query:%{SPACE}%{DATA:query2} %{DATA:queryclass} %{DATA:querytype} %{DATA:queryflag} \(%{IP:dnsip}\)" ] | |
} | |
tag_on_failure => [ "failedPattern_dns_rule1" ] | |
add_field => [ "received_at", "%{@timestamp}" ] | |
add_tag => [ "dns_query" ] | |
} | |
### Logstash Date | |
### 26-Mar-2019 00:08:47.105 | |
date { | |
locale => "en" | |
timezone => "Asia/Kuala_Lumpur" | |
match => ["timestamp", "d-MMM-yyyy HH:mm:ss.SSS", "dd-MMM-yyyy HH:mm:ss.SSS"] | |
remove_field => ["timestamp"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment