0

I've already got my index (response_summary) created using logstash, which puts data into the index from a MySQL database.

My concern here is, how will I be able to update the index manually whenever a new set of records are being added to the database without deleting and recreating the index yet again.

Or is there a way that it can be done automatically, whenever a db change is done?

Any help could be appreciated.

7
  • 2
    You need your own way of finding out when your sql database changes (regular queries against it or similar) OR when you change something in the DB you do the same in ES. Commented Oct 25, 2016 at 20:14
  • @AndreiStefan I could do it through logstash by inserting a scheduler cron job, but wanted to know if there's any other way to do it using ES. Thanks Commented Oct 26, 2016 at 4:40
  • 1
    No way with ES. There were the rivers in ES, but they were removed in ES 2.0. The alternative is the Logstash JDBC input plugin: elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html Commented Oct 26, 2016 at 4:46
  • For db handling that's fine, what if i'm uploading log files as input, could I use the same scheduler within the input? Commented Oct 26, 2016 at 4:55
  • 1
    No, you use the file input from Logstash which picks up file changes automatically. Commented Oct 26, 2016 at 4:58

1 Answer 1

1

No way with ES. There were the rivers in ES, but they were removed in ES 2.0. The alternative is the Logstash JDBC input plugin to automatically pickup changes based on a defined schedule.

For doing the same with files, you have the LS file input plugin which is tailing the files to pick up the new changes and, also, to keep track of where it left off in case LS is restarted.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks, spot on :)
I tried with the jdbc schedule in logstash conf, but when i checked it with Kibana it only takes the last record which I added, not the whole! I added something like this: schedule => "* * * * *"
And the query used covers all the data?
Sorry @Andrei, it was my mistake. The document_id was wrong. It works perfectly now!
@AndreiStefan, i am facing the same issue, except when i try to do an update, any new row is getting updated in the index, the old row updation is also added as a new row. I want the old index row to get updated. Ive also posted a detailed question here . Could you please help me?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.