Hi,
I'm trying to come up with a logstash.conf to seperate the indexing method between 2 different sources. One will be daily index and other will be monthly index. I came up with something like this but it didn't work.
And with this one it created two indices(example: 1 daily and 1monthly indice for both x and y sources) for the same source. How can i solve this issue?
It worked!! Thank you so much sir. I have one last question. This was merely a test environment to check multiple output conditions. In production we have a much larger indice pool and would like to make some adjustments to indexing with a similar output config. Is it possible to define multiple indices to a single if statement using comma as a seperator? Pretty much like this:
I didn't quite understand this. I dont want to have one output, i need to seperate certain indices as daily or monthly. Also i couldn't picture how the line you gave fits in a config since i'm pretty bad at the filter section. Do you have a complete config as example so i can make sense somehow? Or check my conf out and edit that if you'd like.
input {
gelf {
port => 12201
}
}
filter {
}
output {
if [tag] == "x" {
elasticsearch {
hosts => ["https://odfe-node1:9200"]
index => "%{tag}-%{+YYYY.MM.dd}"
ssl => true
ssl_certificate_verification => false
user => *****
password => *****
ilm_enabled => false
}
}
if [tag] == "y" {
elasticsearch {
hosts => ["https://odfe-node1:9200"]
index => "%{tag}-%{+YYYY.MM}"
ssl => true
ssl_certificate_verification => false
user => *****
password => *****
ilm_enabled => false
}
}
stdout{
}
}
What happens if i have 4 indices a, b, c and d and i set a, b as daily and c, d as monthly? And what must i do to add an "e" indice when this logstash is running? Does metadata part also cover this? Or must i add "e" to the conf and restart logstash? Sorry for bombarding you with questions, i'm just trying to fully grasp this.
Thanks.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.