<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Parsing XML having seperate date and time tags in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127897#M26274</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;
i can not lead you to a complete answer to this, but maybe i can give you an idea or something to search for. It looks like you need a custom datetime.xml for your sourcetype to solve this problem. The bad thing is, that there is only poorly documentation for the datetime.xml &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Maybe some examples can help:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem"&gt;http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/"&gt;http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2015 09:27:35 GMT</pubDate>
    <dc:creator>tom_frotscher</dc:creator>
    <dc:date>2015-04-27T09:27:35Z</dc:date>
    <item>
      <title>Parsing XML having seperate date and time tags</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127895#M26272</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;I am having following xml log which has two seperate tags for Date and time. I want to use Date + Time together as timestamp.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;data&amp;gt;
    &amp;lt;detail&amp;gt;
        &amp;lt;date&amp;gt;01-17-2015&amp;lt;/date&amp;gt;
        &amp;lt;time&amp;gt;10:35:235&amp;lt;/time&amp;gt;
        &amp;lt;country&amp;gt;US&amp;lt;/country&amp;gt;
    &amp;lt;/detail&amp;gt;
    &amp;lt;detail&amp;gt;
        &amp;lt;date&amp;gt;01-18-2015&amp;lt;/date&amp;gt;
        &amp;lt;time&amp;gt;12:21:754&amp;lt;/time&amp;gt;
        &amp;lt;country&amp;gt;US&amp;lt;/country&amp;gt;
    &amp;lt;/detail&amp;gt;
&amp;lt;/data&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here, I want use &amp;amp;ltdate&amp;amp;gt + &amp;amp;lttime&amp;amp;gt as TIME_PREFIX. What value of TIME_PREFIX should be set in props.conf?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127895#M26272</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2020-09-28T18:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML having seperate date and time tags</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127896#M26273</link>
      <description>&lt;P&gt;Any way to solve this case?&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 09:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127896#M26273</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-04-27T09:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML having seperate date and time tags</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127897#M26274</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
i can not lead you to a complete answer to this, but maybe i can give you an idea or something to search for. It looks like you need a custom datetime.xml for your sourcetype to solve this problem. The bad thing is, that there is only poorly documentation for the datetime.xml &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Maybe some examples can help:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem"&gt;http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/"&gt;http://blogs.splunk.com/2009/12/02/configure-splunk-to-pull-a-date-out-of-a-non-standard-filename/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 09:27:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127897#M26274</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2015-04-27T09:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML having seperate date and time tags</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127898#M26275</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;datetime.xml&lt;/CODE&gt;; to use the first date/time pair, do this:&lt;/P&gt;

&lt;P&gt;Inside &lt;CODE&gt;/opt/splunk/etc/apps/myApp/default/props.conf&lt;/CODE&gt; do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourceType]
DATETIME_CONFIG = /etc/apps/myApp/default/datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Inside &lt;CODE&gt;/opt/splunk/etc/apps/myApp/default/datetime.xml&lt;/CODE&gt; do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;datetime&amp;amp;gt;
&amp;amp;lt;define name="_myXMLdate" extract="month, day, year"&amp;amp;gt;
&amp;amp;lt;text&amp;amp;gt;&amp;amp;lt;![CDATA[&amp;amp;lt;date&amp;amp;gt;(\d(2)-\d(2)-(\d{4})&amp;amp;lt;\date&amp;amp;gt;]]&amp;amp;gt;&amp;amp;lt;/text&amp;amp;gt;
&amp;amp;lt;/define&amp;amp;gt;
&amp;amp;lt;define name="_myXMLtime" extract="hour, minute"&amp;amp;gt;
&amp;amp;lt;text&amp;amp;gt;&amp;amp;lt;![CDATA[&amp;amp;lt;time&amp;amp;gt;(\d{2}):(\d{2}):\d{3}&amp;amp;lt;/time&amp;amp;gt;]]&amp;amp;gt;&amp;amp;lt;/text&amp;amp;gt;
&amp;amp;lt;/define&amp;amp;gt;
&amp;amp;lt;timePatterns&amp;amp;gt;
&amp;amp;lt;use name="_myXMLtime"/&amp;amp;gt;
&amp;amp;lt;/timePatterns&amp;amp;gt;
&amp;amp;lt;datePatterns&amp;amp;gt;
&amp;amp;lt;use name="_myXMLdate"/&amp;amp;gt;
&amp;amp;lt;/datePatterns&amp;amp;gt;
&amp;amp;lt;/datetime&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2015 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-having-seperate-date-and-time-tags/m-p/127898#M26275</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-12T21:08:26Z</dc:date>
    </item>
  </channel>
</rss>

