I'm bringing table A and B from postgres. I want to apply the ruby filter in different forms. How should I set it up?
input {
jdbc { tags => table A }
jdbc { tags => table B }
}
filter {
ruby {
code=> "require 'json'
...
"
}
This ruby filter only says'event'. How does the ruby filter know this? Is it a filter on table A or a filter on table B?
}
@ptamba hello. as you can see, I already applied tags in each inputs. What I asked is how to apply the filter to each tag, so if you know about this, please explain it with code. thank you
input {
jdbc {
#jdbc settings for tableA
tags => ["tableA"]
}
jdbc
#jdbc setting for tableB
{
tags => ["tableB"]
}
}
filter {
if "tableA" in [tags] {
ruby {
#ruby codes for A here
}
}
else if "tableB" in [tags] {
ruby {
# ruby codes for tableB here
}
}
Thanks. It helped a lot. When I only looked at the document, I wasn't really sure if I could use the filter under these conditions.
May I ask you one more? I want to clone "tableA" based on your example and divide it into "tableA-1" and "tableA-2", and output three tablesB to the index of elasticsearch respectively. TableA already has a type, is it possible to clone it and give it another type? I have to divide as "tableA-1", "tableA-2", "tableB"
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.