<?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 Extracting timestamps in custom data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334873#M61929</link>
    <description>&lt;P&gt;Hi Guys, &lt;/P&gt;

&lt;P&gt;I am trying to use the GUI to index a file that's not in a recognised format and I'm having issues with extracting the timestamp. &lt;/P&gt;

&lt;P&gt;I have broken the event up fine but the timestamp is on the line shown below. The first time it finds "12:00:00" is incorrect so I'm looking to extract the incident time as the time section of my date and timestamp.   &lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Date Of Incident: 12/02/2015 12:00:00 AM, Incident Time: 1250&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;In the timestamp prefix section I have told it to look after Date of Incident: but it only finds 12/02/2015 12:00:00 AM. Does anyone know of a way to tell it to continue looking so I add the correct incident time?&lt;/P&gt;

&lt;P&gt;Any help would be appreciated as I am really struggling with this!&lt;/P&gt;

&lt;P&gt;Thanks! &lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 11:23:49 GMT</pubDate>
    <dc:creator>Robbie1194</dc:creator>
    <dc:date>2017-07-27T11:23:49Z</dc:date>
    <item>
      <title>Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334873#M61929</link>
      <description>&lt;P&gt;Hi Guys, &lt;/P&gt;

&lt;P&gt;I am trying to use the GUI to index a file that's not in a recognised format and I'm having issues with extracting the timestamp. &lt;/P&gt;

&lt;P&gt;I have broken the event up fine but the timestamp is on the line shown below. The first time it finds "12:00:00" is incorrect so I'm looking to extract the incident time as the time section of my date and timestamp.   &lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Date Of Incident: 12/02/2015 12:00:00 AM, Incident Time: 1250&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;In the timestamp prefix section I have told it to look after Date of Incident: but it only finds 12/02/2015 12:00:00 AM. Does anyone know of a way to tell it to continue looking so I add the correct incident time?&lt;/P&gt;

&lt;P&gt;Any help would be appreciated as I am really struggling with this!&lt;/P&gt;

&lt;P&gt;Thanks! &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 11:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334873#M61929</guid>
      <dc:creator>Robbie1194</dc:creator>
      <dc:date>2017-07-27T11:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334874#M61930</link>
      <description>&lt;P&gt;So just to make it clean (I didn't explain myself very well), the timestamp I'm looking to extract would be 12/02/2015 12:50:00&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 11:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334874#M61930</guid>
      <dc:creator>Robbie1194</dc:creator>
      <dc:date>2017-07-27T11:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334875#M61931</link>
      <description>&lt;P&gt;In the Select sourcetype screen, go to advanced tab on left sidebar and add following attributes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = Date Of Incident:\s+
TIME_FORMAT = %m/%d/%Y %H:%M:%S %p
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334875#M61931</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-27T12:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334876#M61932</link>
      <description>&lt;P&gt;Hi somesoni2 &lt;/P&gt;

&lt;P&gt;Unfortunately that doesn't work, it still finds 12/02/2015 12:00:00 instead of 12/02/2015 12:50:00.&lt;/P&gt;

&lt;P&gt;I need to take the incident time value and add it to the Date of Incident date. &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:27:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334876#M61932</guid>
      <dc:creator>Robbie1194</dc:creator>
      <dc:date>2017-07-27T12:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334877#M61933</link>
      <description>&lt;P&gt;Can you tell us more about this data source? &lt;/P&gt;

&lt;P&gt;How often do you ingest events, is it a file monitor?  do you have control of the format?&lt;/P&gt;

&lt;P&gt;You may need to live with the date parsing and deal with the time at search time at this point. The data's format is poor and I would look at cleaning it up at the source if at all possible. &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334877#M61933</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-07-27T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334878#M61934</link>
      <description>&lt;P&gt;It's a file monitor and unfortunately there's no way of me changing the data's format &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:01:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334878#M61934</guid>
      <dc:creator>Robbie1194</dc:creator>
      <dc:date>2017-07-27T13:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334879#M61935</link>
      <description>&lt;P&gt;Hi Robbie1194,&lt;BR /&gt;
I think that the only way is pre parse your files using a script!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334879#M61935</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-27T13:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334880#M61936</link>
      <description>&lt;P&gt;Hi Robbie1194,&lt;BR /&gt;
I think that the only way is pre parse your files using a script!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334880#M61936</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-27T13:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334881#M61937</link>
      <description>&lt;P&gt;Ok, so let's talk use cases. &lt;/P&gt;

&lt;P&gt;With the extraction of the "Date of Incident", you can at least be sure that your events indexed and are groupable by day. Then using an extracted field you could extract time. You can then eval a field that stitches them together and you could chart using that data. &lt;/P&gt;

&lt;P&gt;What are some of the things you are going to try and achieve with this data...Charting incidents over time? reporting on the number of incidents over time? drilldown to view the incident?&lt;/P&gt;

&lt;P&gt;What does a full event look like?&lt;/P&gt;

&lt;P&gt;Splunk's power is in the ability to constantly change schema on the fly and to massage data, so there are many ways to go about this, but generally the most critical use case or item you are trying to achieve will dictate the levers to pull. &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334881#M61937</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-07-27T13:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334882#M61938</link>
      <description>&lt;P&gt;@Robbie1194, if the log always has &lt;CODE&gt;12:00:00 AM&lt;/CODE&gt; present for the Date field, you can try the following in your sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT=%d/%m/%Y 12:00:00 AM, Incident Time: %H%M
TIME_PREFIX=Date Of Incident:\s+
MAX_TIMESTAMP_LOOKAHEAD=43
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it not not always fixed as 12:00:00 AM, then you might have to create your own datetime configuration xml (yourcustomdatetime.xml) instead of relying upon the default datetime.xml.&lt;/P&gt;

&lt;P&gt;Here is a blog explaining the same: &lt;A href="https://www.splunk.com/blog/2014/04/23/its-that-time-again.html"&gt;https://www.splunk.com/blog/2014/04/23/its-that-time-again.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334882#M61938</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-27T13:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334883#M61939</link>
      <description>&lt;P&gt;Try with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = Date Of Incident:\s+
 TIME_FORMAT = %m/%d/%Y 12:00:00 AM, Incident Time: %H%M
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334883#M61939</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-27T13:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334884#M61940</link>
      <description>&lt;P&gt;worked for me&lt;/P&gt;

&lt;P&gt;as long as the pattern stays the same should work. &lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i.imgur.com/eyGZ78e.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334884#M61940</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-07-27T13:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting timestamps in custom data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334885#M61941</link>
      <description>&lt;P&gt;looks good, like niketnilay said, as long as you can trust that regex will always hit, you are golden&lt;IMG src="http://i.imgur.com/eyGZ78e.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-timestamps-in-custom-data/m-p/334885#M61941</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-07-27T13:55:46Z</dc:date>
    </item>
  </channel>
</rss>

