How to create if conditional statement in logstash config file



how to select the mysql query in elasticsearch config file based on if condition statement?

(Christian Dahlqvist) #2

There is no MySQL query in the elasticsearch.yml file and no conditionals. What are you trying to do?


Actually i fetch the data from mysql.

is there any alter option available?

(Christian Dahlqvist) #4

One way to move data from MySQL to Elasticsearch is using Logstash. Elasticsearch has no built in way to do this.


Absolutely i tried in this way only.


now i can able to make conditional statement?

(Christian Dahlqvist) #7

What type of conditional statement?


If conditional statement

(Christian Dahlqvist) #9

As I said earlier, you most likely need to use Logstash to move data from MySQL to Elasticsearch. Have a look at the Logstash documentation and this blog post and the official documentation on how to use the jdbc input plugin. If you have any further questions on this, create a thread in the Logstash category.


if [status_id] == 1 means i need to change this name to "lowest version"

can u explain how to do this?

(Christian Dahlqvist) #11

If this is a Logstash question, please create a new thread under the Logstash category where you describe what you want to do and what you have got so far in terms of configuration. The more specific questions you have the more likely you are to get a response, so make sure you have gone through the documentation and understand how Logstash works. This blog post may also be a good resource even though it does not use the jdbc input plugin.


thank you

(system) #13

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.