<?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: Add time in search string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323567#M162717</link>
    <description>&lt;P&gt;@p_gaurav&lt;/P&gt;

&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;

&lt;P&gt;Query is not provding any output.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2018 04:32:28 GMT</pubDate>
    <dc:creator>vik123ash</dc:creator>
    <dc:date>2018-02-27T04:32:28Z</dc:date>
    <item>
      <title>Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323565#M162715</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;i want to add time in search string.&lt;/P&gt;

&lt;P&gt;My data is showing time 26-02-2018T02:00:00.000+0000, but while searching i want to add 11 hour , means it should create filter for time 27-02-2018T13:00:00.000+0000.&lt;/P&gt;

&lt;P&gt;Also after this i also want to apply substring on time to just show dates.&lt;/P&gt;

&lt;P&gt;i am using below one, but its not working.&lt;/P&gt;

&lt;P&gt;index=XXXXXX  source="XXXXXX"  |eval host=add(Date,+11) | eval hostgroup=substr(Date,1,10) | stats count(Date) by hostgroup&lt;/P&gt;

&lt;P&gt;Please help.&lt;/P&gt;

&lt;P&gt;Vikash&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 03:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323565#M162715</guid>
      <dc:creator>vik123ash</dc:creator>
      <dc:date>2018-02-27T03:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323566#M162716</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This may be helpful for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXXXXX source="XXXXXX" |eval date=strftime(Date, "%d-%m-%Y %H:%M:%S.%3N%z") | eval date1=date+39600 | eval  hostgroup =strptime(date1, "%d-%m-%Y") | stats count(date) by hostgroup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2018 04:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323566#M162716</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-02-27T04:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323567#M162717</link>
      <description>&lt;P&gt;@p_gaurav&lt;/P&gt;

&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;

&lt;P&gt;Query is not provding any output.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 04:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323567#M162717</guid>
      <dc:creator>vik123ash</dc:creator>
      <dc:date>2018-02-27T04:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323568#M162718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;can you tell me output of this:&lt;BR /&gt;
 index=XXXXXX source="XXXXXX" |eval date=strftime(_time, "%d-%m-%Y %H:%M:%S")&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 04:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323568#M162718</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-02-27T04:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323569#M162719</link>
      <description>&lt;P&gt;I have too many date fields, out of which i want to create filter for one of the date field. i am not sure if _time will help here.&lt;/P&gt;

&lt;P&gt;Below is the date field on which i need to execute the query.&lt;BR /&gt;
CDate:   2018-02-27T03:55:28.000+0000   &lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 04:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323569#M162719</guid>
      <dc:creator>vik123ash</dc:creator>
      <dc:date>2018-02-27T04:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323570#M162720</link>
      <description>&lt;P&gt;Hi @p_gaurav&lt;/P&gt;

&lt;P&gt;We are getting output 0 though we have non-zero value.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 05:44:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323570#M162720</guid>
      <dc:creator>vik123ash</dc:creator>
      <dc:date>2018-02-27T05:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add time in search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323571#M162721</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;index=XXXXXX source="XXXXXX" |eval date=strptime(CDate, "%d-%m-%Y %H:%M:%S.%3N%z") | eval date1=date+39600 | eval  hostgroup =strftime(date1, "%d-%m-%Y") | stats count(CDate) by hostgroup&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 06:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-time-in-search-string/m-p/323571#M162721</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-02-27T06:17:34Z</dc:date>
    </item>
  </channel>
</rss>

