# Extract timestamp from xml comment

**URL:** <https://discuss.elastic.co/t/extract-timestamp-from-xml-comment/121192>\
**Category:** Logstash\
**Created:** [February 23, 2018, 9:42am UTC](https://discuss.elastic.co/t/extract-timestamp-from-xml-comment/121192 "2018-02-23T09:42:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s\_b92](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@s\_b92](https://discuss.elastic.co/u/s_b92)\
**Post date:** [February 23, 2018, 9:42am UTC](https://discuss.elastic.co/t/extract-timestamp-from-xml-comment/121192/1 "2018-02-23T09:42:44Z")

</div>

Hi guys,  
I have a problem to extract a timestamp from a xml document. The timestamp information is nested in a xml comment. Here is an example of this XML comment.

Export created at **2017-11-10 14:01:59Z** by SPIDSS IMS Template Release 'CSMD Mietkautionskontoinhaber' / SpdmsIdsTemplateRelease.1.28.05, Version=1.28.6494.14187, Culture=neutral, PublicKeyToken=null (build date: 2017-10-12 08:52:54Z)

Normal this information stands in a xml comment. But when I try it to copy it in a full context. Then this example will not shown here.

I am interested in the timestamp information which is displayed here bold!

To read the xml file I decided to read it over a normal input file plugin.

input{  
file {  
path =\> "C:/ELK/Manually\_Reports/XML/\*.xml"  
start\_position =\> "beginning"  
tags =\> ["XML"]  
codec =\> multiline {  
pattern =\> "^%{TIMESTAMP\_ISO8601} "  
negate =\> false  
what =\> previous  
}}

But I don't know how I can get the timestamp information.  
I try to build a grok filter match. But my try failed.  
It would be very nice, when somebody of you can help me.

Thanks for your time and help!

Regards  
Simon

---

<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:** [March 23, 2018, 9:43am UTC](https://discuss.elastic.co/t/extract-timestamp-from-xml-comment/121192/2 "2018-03-23T09:43:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
