I’m trying convert timestamp I got from Elasticsearch to Unix time format. However, the item name of this timestamp is “@timestamp”, and this is causing n8n not able to recognize this item and showing [ERROR: invalid syntax] error.
I have tried copying the actual timestamp value as an input, and it works. That’s why I believe this is due to the “@” character in the field name instead of the actual value.
I am sorry you’re having trouble. You’re quite right here, the dot notation $json._source.@timestamp will fail because of the @ character. You should, however, be able to make this work by manually setting an expression using the bracket notation. Like this:
{{ $json['_source']['@timestamp'] }}
This is explained in more detail here for example, though ideally n8n would handle this automatically for field names like yours. I’ll make sure to add this to our internal list of improvement ideas.
Let me know if you’re still running into trouble after updating your expression as suggested above