<?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: Specifying today's date in the source file on a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64761#M15996</link>
    <description>&lt;P&gt;use the function now() in a subsearch or a macro.&lt;/P&gt;

&lt;P&gt;the search to generate a condition : &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count  | eval date=strftime(now(),"%Y%m%d") | eval source="C:logs\\path\\iislog_".date.".log" | table source&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;the search using the sub search to generate a source condition&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* [ | stats count  | eval date=strftime(now(),"%Y%m%d") | eval source="C:logs\\path\\iislog_".date.".log" | table source]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;you could improve by using a macro too.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2013 20:03:43 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2013-09-16T20:03:43Z</dc:date>
    <item>
      <title>Specifying today's date in the source file on a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64759#M15994</link>
      <description>&lt;P&gt;Is there a way to specify today's date in the filename of the source on the search?  I'm thinking in the same way you would put it in a bash script.  Pseudocode:&lt;/P&gt;

&lt;P&gt;source="C:logs\\path\\iislog_(time(%y%m%d)).log"&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 19:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64759#M15994</guid>
      <dc:creator>DavidGuarneri</dc:creator>
      <dc:date>2013-09-16T19:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying today's date in the source file on a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64760#M15995</link>
      <description>&lt;P&gt;Use a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| stats count | eval source="C:\\logs\\path\\iislog".strftime(now(),"%y%m%d").".log" | fields source]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Sep 2013 19:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64760#M15995</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-16T19:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying today's date in the source file on a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64761#M15996</link>
      <description>&lt;P&gt;use the function now() in a subsearch or a macro.&lt;/P&gt;

&lt;P&gt;the search to generate a condition : &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count  | eval date=strftime(now(),"%Y%m%d") | eval source="C:logs\\path\\iislog_".date.".log" | table source&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;the search using the sub search to generate a source condition&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* [ | stats count  | eval date=strftime(now(),"%Y%m%d") | eval source="C:logs\\path\\iislog_".date.".log" | table source]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;you could improve by using a macro too.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 20:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64761#M15996</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-09-16T20:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying today's date in the source file on a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64762#M15997</link>
      <description>&lt;P&gt;You are a kung fu master Ayn !&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 20:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64762#M15997</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-09-16T20:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying today's date in the source file on a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64763#M15998</link>
      <description>&lt;P&gt;That worked, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2013 20:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specifying-today-s-date-in-the-source-file-on-a-search/m-p/64763#M15998</guid>
      <dc:creator>DavidGuarneri</dc:creator>
      <dc:date>2013-09-16T20:43:57Z</dc:date>
    </item>
  </channel>
</rss>

