Hi, I was trying to create an index based on time, but with a different name. For example if I want to create an index called "nginx- *", at the time of consulting will be nginx-2018.11.05, but I need to geolocate, and reading articles, can only be "logstash" the name of the index to create the geoip.
So in what way could I create an index based on time with geolocation ?, and how do I call it in logstash ?.
This is my current .conf.
input {
file {
path => "/var/log/nginx"
start_position => "beginning"
stat_interval => 1
discover_interval => 15
sincedb_path => "/dev/null"
sincedb_write_interval => 15
}
}
filter {
grok {
patterns_dir => "/etc/logstash/patterns/"
match => { "message" => "%{NGINXDATE:logtimestamp}" }
}
date { match => [ "logtimestamp", "MMM dd HH:mm:ss", "MMM d HH:mm:ss" ] }
grok {
patterns_dir => "/etc/logstash/patterns"
match => { "message" => "%{NGINX_ACCESS}" }
remove_tag => ["_grokparsefailure"]
add_tag => ["nginx_access"]
}
grok {
match => { "agent" => "[(]%{DATA:OS}; %{DATA:version}; %{DATA:device}[)]" }
match => { "agent" => "[(]%{DATA:OS}[)]" }
}
geoip {
source => "clientip"
}
mutate {
remove_field => [ "type", "path", "host"]
}
}
output {
elasticsearch {
hosts => ["192.168.1.105:9200"]
index => "logstash-nginx"
}
}
I'm new to this, sorry.
Regards,