Here is the config file
input {
file {
path => "/apps/syslog-ng/messages_*"
start_position => "beginning"
sincedb_path => "/dev/null"
add_field => { "log_type" => "firewalllog" }
}
}
filter {
if [log_type] == "firewalllog" {
grok {
match => {
"message" => "%{TIMESTAMP_ISO8601:time}\s*%{URIHOST:host}\s*(?:%{NUMBER:id:int}|-).*? .*?,.*?,%{GREEDYDATA:pal_config},.*,.*,%{GREEDYDATA:pal_ig},%{GREEDYDATA:source_ip},,.*?,%{USERNAME:username},.*?,.*? \S+\S+,.*?,\S+,,%{URIHOST:hostname}"
}
}
grok {
match => {
"message" => "%{TIMESTAMP_ISO8601:date}.*user.*?%{USERNAME:user}.*address.*%{IP:serverip}.*From:\s*%{IP:ip}.*%{URIHOST:host}"
}
}
}
mutate {
remove_field => ["_type"]
}
}
output {
stdout {
codec => rubydebug
}
file {
path => "/tmp/log.log"
codec => "json_lines"
}
elasticsearch {
hosts => ["
https://your-elasticsearch-host:9200"]
index => "your-index-name-%{+YYYY.MM.dd}"
user => "your-username"
password => "your-password"
ssl => true
ssl_certificate_verification => false
}
}