0

I have a feeling that my question must have a trivial answer but several hours of googling and searching python tutorials and I am still stuck.

My Field names often contain the "@" character (i.e @timestamp) and the "@" is used by python for decorator functions.

How do you reference these field names in elasticsearch-dsl? (I am using python 3.6.2)

resp = s.execute()

for hit in resp:
    print(hit.response_code)
    print(hit.@timestamp)

Of course I tried escaping and quoting.

1 Answer 1

1

you can always use hit['@timestamp'] or getattr(hit, '@timestamp')

Sign up to request clarification or add additional context in comments.

1 Comment

Thx a lot, I new I was missing something trivial. Regards, Peter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.