# Cannot get date to match timestamp after xml parsing

**URL:** <https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327>\
**Category:** Logstash\
**Created:** [April 5, 2016, 5:53am UTC](https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327 "2016-04-05T05:53:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![whyapenny](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@whyapenny](https://discuss.elastic.co/u/whyapenny)\
**Post date:** [April 5, 2016, 5:53am UTC](https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327/1 "2016-04-05T05:53:27Z")

</div>

here is the xml field that comes in originally (xml parsing works fine, and this field shows up in kibana as entry.Timestamp):  
2016-04-04T17:45:34.498-04:00

here is what the json looks like after xml parsing:  
"entry": {  
"Timestamp": ["2016-04-04T17:45:34.498-04:00"]  
}

i have tried the following in the date filter:  
match =\> ["entry.Timestamp", "YYYY-MM-dd HH:mm:ss,SSSZ", "ISO8601"]  
match =\> ["Timestamp", "YYYY-MM-dd HH:mm:ss,SSSZ", "ISO8601"]

no matter what i do I cannot get @timestamp to pull this time. I tried adding  
"YYYY-MM-dd'T'HH:mm:ss,SSSZ"  
but that resulted in errors. there are no errors and no logs to why it doesn't match.

config currently looks like after trying to match "Timestamp" as well as "entryTimestamp":  
if "myFirstDate" in [type]{  
xml {  
target =\> entry  
source =\> message  
}  
date{  
match =\> ["entry.Timestamp", "YYYY-MM-dd HH:mm:ss,SSSZ", "ISO8601", "UNIX\_MS", "UNIX", "MMMM d YYYY, HH:mm:ss.SSS", "MMMM dd YYYY, HH:mm:ss.SSS"]  
add\_tag =\> ["dated"]  
}

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 5, 2016, 5:54am UTC](https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327/2 "2016-04-05T05:54:56Z")

</div>

The correct syntax for referring to nested fields isn't `entry.Timestamp`. See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references).

---

<div class="post-metadata">

**Author:** ![whyapenny](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@whyapenny](https://discuss.elastic.co/u/whyapenny)\
**Post date:** [April 5, 2016, 8:33pm UTC](https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327/3 "2016-04-05T20:33:13Z")

</div>

indeed that would be my issue. This is my first time dealing with nested fields and i had no idea how to consume them. For those other newbs to nested fields, this is how i handled it:

match =\> ["[entry][Timestamp]", "YYYY-MM-dd HH:mm:ss,SSSZ", "ISO8601" ]

and voila, disco.

Thanks magnus.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:03am UTC](https://discuss.elastic.co/t/cannot-get-date-to-match-timestamp-after-xml-parsing/46327/4 "2017-07-06T05:03:42Z")

</div>


