<?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: Extracting Date and Time from Events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512195#M86920</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Assuming that's the correct sourcetype, then the timestamp settings don't match the data, which means Splunk will default to the current time.&amp;nbsp; You should see messages in splunkd.log about not being able to find timestamps in the data.&amp;nbsp; Use this search to find them.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal sourcetype=splunkd component=DateParserVerbose log_level=WARN&lt;/LI-CODE&gt;&lt;P&gt;Try these props.conf settings to better parse those timestamps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVENT_BREAKER = ([\r\n]+)
EVENT_BREAKER_ENABLE = TRUE
LINE_BREAKER = ([\r\n]+)
MAX_TIMESTAMP_LOOKAHEAD = 100
SHOULD_LINEMERGE = 0
TIME_PREFIX = ^
TIME_FORMAT = %b %d %H:%M:%S
TRUNCATE = 2500&lt;/LI-CODE&gt;&lt;P&gt;I've found the easiest way to test props.conf settings is to use the Add Data wizard.&amp;nbsp; Save some sample events to a file on your workstation then go to Settings-&amp;gt;Add Data.&amp;nbsp; Select the option to upload a file and choose the file with the sample data.&amp;nbsp; In the "Set Source Type" window, click on Advanced and enter the properties in the boxes.&amp;nbsp; Click Apply to see if times are parsed correctly.&amp;nbsp; If the settings work, cancel the upload and put the props.conf settings on your indexers.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Aug 2020 18:24:30 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-08-03T18:24:30Z</dc:date>
    <item>
      <title>Extracting Date and Time from Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512167#M86910</link>
      <description>&lt;P&gt;How do I extract the date and time from my events?&lt;/P&gt;&lt;P&gt;Event Data Sample&lt;BR /&gt;-------------------------&lt;BR /&gt;Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;Jun 4 02:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;Jun 4 00:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;Jul 31 22:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;BR /&gt;Jul 31 08:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;/P&gt;&lt;P&gt;My Search&lt;BR /&gt;-----------------&lt;BR /&gt;index=sso host=rofsso504* PartitionDiskSpaceUsed&amp;gt;25 earliest=-2mon&lt;BR /&gt;| rename _raw as Event host as Host&lt;BR /&gt;| eval Timestamp=strftime(_time, "%b %d %H:%M:%S")&lt;BR /&gt;| table Host _time Timestamp PartitionDiskSpaceUsed Event&lt;BR /&gt;| sort Host -Timestamp | table _time Timestamp PartitionDiskSpaceUsed Event&lt;/P&gt;&lt;P&gt;What I want&lt;BR /&gt;------------------&lt;BR /&gt;I want the Timestamp column to contain the correct Event Date and Time, but currently it shows the DateTime of the search.&lt;/P&gt;&lt;P&gt;2020-06-04 00:50:56 Jun 04 &lt;FONT color="#339966"&gt;01:27:01&lt;/FONT&gt; 100 Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-06-04 00:50:56 Jun 04 &lt;FONT color="#339966"&gt;02:27:01&lt;/FONT&gt; 100 Jun 4 02:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-06-04 00:50:56 Jun 04 &lt;FONT color="#339966"&gt;00:27:01&lt;/FONT&gt; 100 Jun 4 00:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-07-31 00:50:56 Jul 31 &lt;FONT color="#339966"&gt;22:27:01&lt;/FONT&gt; 26 Jul 31 22:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;BR /&gt;2020-07-31 00:50:56 Jul 31 &lt;FONT color="#339966"&gt;08:27:01&lt;/FONT&gt; 26 Jul 31 08:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I get&lt;BR /&gt;------------&lt;BR /&gt;2020-06-04 00:50:56 Jun 04 &lt;STRIKE&gt;00:50:56&lt;/STRIKE&gt; 100 Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-06-04 00:50:56 Jun 04 &lt;STRIKE&gt;00:50:56&lt;/STRIKE&gt; 100 Jun 4 02:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-06-04 00:50:56 Jun 04 &lt;STRIKE&gt;00:50:56&lt;/STRIKE&gt; 100 Jun 4 00:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;BR /&gt;2020-07-31 00:50:56 Jul 31 &lt;STRIKE&gt;00:50:56&lt;/STRIKE&gt; 26 Jul 31 22:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;BR /&gt;2020-07-31 00:50:56 Jul 31 &lt;STRIKE&gt;00:50:56&lt;/STRIKE&gt; 26 Jul 31 08:27:01 rofsso504a Usage: /dev/sda4 210G 53G 157G 26% /home&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 15:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512167#M86910</guid>
      <dc:creator>NealBr</dc:creator>
      <dc:date>2020-08-03T15:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Date and Time from Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512181#M86911</link>
      <description>&lt;P&gt;It looks like your query does not match your output.&amp;nbsp; I see two timestamp fields in the table command, but three timestamps are shown in the output.&lt;/P&gt;&lt;P&gt;Can you share the props.conf settings for this sourcetype?&amp;nbsp; There may be an error in how the data is onboarded.&amp;nbsp; Specifically. the timestamp may not be set correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 16:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512181#M86911</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-03T16:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Date and Time from Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512192#M86912</link>
      <description>&lt;P&gt;Actually, the output has only two DateTime fields (the third one is just the event text). In total there are four fields. For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;_time:&amp;nbsp; &amp;nbsp;2020-06-04 00:50:56&lt;/LI&gt;&lt;LI&gt;Timestamp:&amp;nbsp; &amp;nbsp;Jun 04 00:50:56&lt;/LI&gt;&lt;LI&gt;PartitionDiskSpaceUsed:&amp;nbsp; &amp;nbsp;100&lt;/LI&gt;&lt;LI&gt;Event:&amp;nbsp; &amp;nbsp;Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Sorry, I'm new to Splunk and I don't understand your question: "Can you share the props.conf settings for this sourcetype?"&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What is my sourcetype?&lt;/LI&gt;&lt;LI&gt;I've no idea where to find my props.config file (but I'm searching online for more info about it.)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 03 Aug 2020 17:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512192#M86912</guid>
      <dc:creator>NealBr</dc:creator>
      <dc:date>2020-08-03T17:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Date and Time from Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512194#M86919</link>
      <description>&lt;P&gt;Found it!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CHARSET = AUTO&lt;/P&gt;&lt;P&gt;EVENT_BREAKER = ([\r\n]+)&lt;/P&gt;&lt;P&gt;EVENT_BREAKER_ENABLE = TRUE&lt;/P&gt;&lt;P&gt;LINE_BREAKER = ([\r\n]+)&lt;/P&gt;&lt;P&gt;MAX_TIMESTAMP_LOOKAHEAD = 100&lt;/P&gt;&lt;P&gt;SHOULD_LINEMERGE = 0&lt;/P&gt;&lt;P&gt;TIME_PREFIX = .+sso\d+.\s&lt;/P&gt;&lt;P&gt;TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N&lt;/P&gt;&lt;P&gt;TRUNCATE = 2500&lt;/P&gt;&lt;P&gt;#NO_BINARY_CHECK = true&lt;/P&gt;&lt;P&gt;category = Custom&lt;/P&gt;&lt;P&gt;disabled = false&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512194#M86919</guid>
      <dc:creator>NealBr</dc:creator>
      <dc:date>2020-08-03T18:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Date and Time from Events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512195#M86920</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Jun 4 01:27:01 rofsso504a Usage: /dev/sda1 16G 16G 20K 100% /&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Assuming that's the correct sourcetype, then the timestamp settings don't match the data, which means Splunk will default to the current time.&amp;nbsp; You should see messages in splunkd.log about not being able to find timestamps in the data.&amp;nbsp; Use this search to find them.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal sourcetype=splunkd component=DateParserVerbose log_level=WARN&lt;/LI-CODE&gt;&lt;P&gt;Try these props.conf settings to better parse those timestamps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVENT_BREAKER = ([\r\n]+)
EVENT_BREAKER_ENABLE = TRUE
LINE_BREAKER = ([\r\n]+)
MAX_TIMESTAMP_LOOKAHEAD = 100
SHOULD_LINEMERGE = 0
TIME_PREFIX = ^
TIME_FORMAT = %b %d %H:%M:%S
TRUNCATE = 2500&lt;/LI-CODE&gt;&lt;P&gt;I've found the easiest way to test props.conf settings is to use the Add Data wizard.&amp;nbsp; Save some sample events to a file on your workstation then go to Settings-&amp;gt;Add Data.&amp;nbsp; Select the option to upload a file and choose the file with the sample data.&amp;nbsp; In the "Set Source Type" window, click on Advanced and enter the properties in the boxes.&amp;nbsp; Click Apply to see if times are parsed correctly.&amp;nbsp; If the settings work, cancel the upload and put the props.conf settings on your indexers.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-Date-and-Time-from-Events/m-p/512195#M86920</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-03T18:24:30Z</dc:date>
    </item>
  </channel>
</rss>

