我使用elasticsearch-dsl-py从elasticsearch中提取数据。
我想保存@timestamp字段(hits.hits._source.@timestamp)的值。但我不知道如何处理Python中不允许使用@字符的事实。
如何从@timestamp中获得值?这样做是行不通的:
h = response.hits[0]
print(h.@timestamp)谢谢
发布于 2016-02-06 17:26:56
在这种情况下,您可以按以下方式访问该字段:
h = response.hits[0]
print h['@timestamp']https://stackoverflow.com/questions/35240835
复制相似问题