Reputation: 63
I'm using elasticsearch-dsl-py
to extract data from elasticsearch
.
I want to save the value of the @timestamp
field (hits.hits._source.@timestamp
). But I have no clue how to deal with the fact that the @
character is not allowed in Python.
How do I get the value from @timestamp
? This does not work:
h = response.hits[0]
print(h.@timestamp)
Thanks
Upvotes: 1
Views: 1039
Reputation: 10278
In that case you can access that field as follows:
h = response.hits[0]
print h['@timestamp']
Upvotes: 2