<?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 Why is the time picker not working with date in logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321182#M95948</link>
    <description>&lt;P&gt;Data is forwarded to Splunk every couple of days meaning that the _time stamp relates to the day it was sent to Splunk. The actual date of the event is listed in the logs as e.g Date="2018-03-29 11:48". &lt;/P&gt;

&lt;P&gt;How can I make the time picker search the date of the event (Date) rather than the date (_time) the data was ingested by Splunk?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary report=jiracsatresults Key="**" Assignee="**" Classification="**"
| dedup Key
| eval dateEpoch = strptime(Date, "%Y-%m-%d %H:%M")
| eval today = now()
| eval daysAgo = round(((today - dateEpoch)/60/60/24), 0) 
|  search daysAgo &amp;lt;= 7
|  table Key, Summary, Reporter, Assignee, Classification, "CSAT Rate", "CSAT Rating Comment", Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only way I get the results for a specific Date e.g for a week is using  &lt;CODE&gt;daysAgo &amp;lt;= 7&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4723iFB93D22E20DEB074/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Apr 2018 14:26:35 GMT</pubDate>
    <dc:creator>davidcraven02</dc:creator>
    <dc:date>2018-04-05T14:26:35Z</dc:date>
    <item>
      <title>Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321182#M95948</link>
      <description>&lt;P&gt;Data is forwarded to Splunk every couple of days meaning that the _time stamp relates to the day it was sent to Splunk. The actual date of the event is listed in the logs as e.g Date="2018-03-29 11:48". &lt;/P&gt;

&lt;P&gt;How can I make the time picker search the date of the event (Date) rather than the date (_time) the data was ingested by Splunk?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary report=jiracsatresults Key="**" Assignee="**" Classification="**"
| dedup Key
| eval dateEpoch = strptime(Date, "%Y-%m-%d %H:%M")
| eval today = now()
| eval daysAgo = round(((today - dateEpoch)/60/60/24), 0) 
|  search daysAgo &amp;lt;= 7
|  table Key, Summary, Reporter, Assignee, Classification, "CSAT Rate", "CSAT Rating Comment", Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only way I get the results for a specific Date e.g for a week is using  &lt;CODE&gt;daysAgo &amp;lt;= 7&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4723iFB93D22E20DEB074/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321182#M95948</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-04-05T14:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321183#M95949</link>
      <description>&lt;P&gt;You need to configure props.conf on the indexer(s) to read the timestamp in the log file and assign it while indexing. If Splunk can't determine a timestamp, it will assign a timestamp of when the event was indexed. Post some sample data and I will help you create that props.conf stanza &lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321183#M95949</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-05T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321184#M95950</link>
      <description>&lt;P&gt;Ok perfect thanks. Here is an example raw log. &lt;/P&gt;

&lt;P&gt;04/02/2018 09:00:00 +0100, search_name="Support - CSAT Results", search_now=1522662477.000, info_min_time=1522656000.000, info_max_time=1522662477.000, info_search_time=1522662477.324, Assignee=test_user, CSAT Rate=5, Classification="Hardware Issues - PC", Date="2018-03-29 11:48", Key="TEST-457", Reporter=test_user, Summary="Laptop Health Checks", report="jiracsatresults"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:56:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321184#M95950</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2020-09-29T18:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321185#M95951</link>
      <description>&lt;P&gt;Add this stanza to your props.conf and restart the splunkd service on the indexers and it will work correctly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[stash]
TIME_PREFIX = Date="
TIME_FORMAT = %Y-%m-%d %H:%M
MAX_TIMESTAMP_LOOKAHEAD = 18
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Apr 2018 15:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321185#M95951</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-05T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321186#M95952</link>
      <description>&lt;P&gt;Thank you but I have just realized that will affect other other logs that actually have the correct date format. &lt;/P&gt;

&lt;P&gt;Would it be possible to have two text inputs "Earliest" and "Latest" which a user can enter the number of days for both to select a period of time. Not sure how to actually implement that.&lt;/P&gt;

&lt;P&gt;i.e   "Earliest" = 40 days ago AND "Latest" = 20 days ago&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 18:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321186#M95952</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-04-05T18:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321187#M95953</link>
      <description>&lt;P&gt;This is the importance of sourcetypes.. You assign a sourcetype on the "shape" of the data. Since this data format has a different shape, you need to assign it a different sourcetype. &lt;/P&gt;

&lt;P&gt;The answer to your question is yes, but the best approach would be to assign it a new sourcetype. &lt;/P&gt;

&lt;P&gt;You will need to first convert that date format into epoch time, then specify the earliest and latest&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 18:23:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321187#M95953</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-05T18:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the time picker not working with date in logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321188#M95954</link>
      <description>&lt;P&gt;Please accept the answer if this answered your question&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 00:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-time-picker-not-working-with-date-in-logs/m-p/321188#M95954</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-06T00:07:13Z</dc:date>
    </item>
  </channel>
</rss>

