Backdating @timestamp into ES data


#1

I have a SQL table that I plan on ingesting via Logstash into Elasticsearch. The entire table needs to be sucked in, but the date in which the data was originally generated is important to me - that is, I want the @timestamp for each resulting document to match a timestamp field that's in my SQL database. How do I do that?


(Aaron Mildenstein) #2

The code for the logstash-input-jdbc plugin already converts SQL time and date values into Logstash Timestamp values. What you will need to do is take the value of your timestamp field, whatever it may be named, and overwrite the @timestamp field with that value.

That could be as simple as having the returning field name in your SQL query be @timestamp.


(system) #3

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