Hello,
I am trying to create an index in ES 7.9.1 with python 3. In order to do so I am using elasticsearch python package.
Script:
doc_id=hex(random.getrandbits(128))[2:]
doc = {
'response_time': measure_response_time(app_url, request_timeout),
'@timestamp': datetime.now()
}
index_name='java-response-time-'+str(datetime.today().strftime('%Y-%m-%d'))
logger.info('index: '+index_name)
res = es.index(index=index_name,id=doc_id, body=doc)
logger.info('Estado nuevo indice: '+str(res['result']))
res = es.get(index=index_name, id=doc_id)
logger.info("Tiempo de respuesta: "+ str(res['_source']['response_time']))
es.indices.refresh(index=index_name)
time.sleep(int(request_frequency))
When I specify @timestamp as a time field:
Documents are missing in "Discover" page:
Reminder: This only happens when I select the field @timestamp as a date time field. If I don't select it, then documents appear.
What is the correct date time format that I must use in my python script?
Thanks in advance!