<?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: How to change the source value in my search when I change the date time range? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274245#M82725</link>
    <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex [| gentimes start=-1 | addinfo | eval source=strftime(info_min_time, "%Y%m%d") | table source ] | rest of your search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Jul 2016 17:05:28 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-07-19T17:05:28Z</dc:date>
    <item>
      <title>How to change the source value in my search when I change the date time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274244#M82724</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;I want to change the source on my request when the timechange.&lt;/P&gt;

&lt;P&gt;I'll explain:&lt;BR /&gt;
I have a lot of directories named by date and I use this as the source.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index source="20160513"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I change the date, I need to change the source value.&lt;BR /&gt;
So, if the earliest time search equals &lt;STRONG&gt;20160522&lt;/STRONG&gt;, then my search will be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex source="20160522"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My test is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex |addinfo | eval time1=strftime(info_min_time, "%Y%m%d")  |where source=time1 |table field1 field2 ......
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this doesn't work for me and I don't know how I can do this.&lt;/P&gt;

&lt;P&gt;if any body have a solution thx&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 16:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274244#M82724</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2016-07-19T16:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the source value in my search when I change the date time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274245#M82725</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex [| gentimes start=-1 | addinfo | eval source=strftime(info_min_time, "%Y%m%d") | table source ] | rest of your search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jul 2016 17:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274245#M82725</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-19T17:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the source value in my search when I change the date time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274246#M82726</link>
      <description>&lt;P&gt;It works very well.&lt;BR /&gt;
What about if I want to search one day ago?&lt;BR /&gt;
I tried this, but it does not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex [| gentimes start=-1 | addinfo | eval source=relative_time(strftime(info_min_time,"-1d@d"), "%Y%m%d") | table source ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jul 2016 08:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-source-value-in-my-search-when-I-change-the/m-p/274246#M82726</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2016-07-22T08:10:35Z</dc:date>
    </item>
  </channel>
</rss>

