How to populate @timestamp and @version when using Elasticsearch API to import json


#1

Question:
How do I use Ealsticsearch API to populate @timestamp and @version as part of the elasticsearch documentation when importing json file?

More information:
In our ELK development process, we are using two different approaches to importing data into Elasticsearch:

  1. Importing log files through Logstash
  2. Importing json files through a customized python script using Elasticsearch API

When importing log files using Logstash, we can specify in the Logstash configuration file whether to populate @timestamp and @version and so on when populating the document in Elasticsearch.

When importing json through a python script using elasticsearch, @timestamp and @version are not populated. What API command should we use here?

Thank you.

Regards,
Nars


(David Pilato) #2

Elasticsearch never generates it. You need to provide those fields yourself if you need them.


#3

Thank you for the response!! Now at least I know this option is not available and I can certainly work on a solution for this. Thank you.


(system) #4

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