<?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: Filtering in search. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199734#M57854</link>
    <description>&lt;P&gt;Everyone should have such a list &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Mar 2014 11:42:51 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-27T11:42:51Z</dc:date>
    <item>
      <title>Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199730#M57850</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I  have a search string like &lt;BR /&gt;
host=ABC "Sales Month"="March"|.....&lt;BR /&gt;
Instead of hard coding the month March can I make it dynamic. &lt;BR /&gt;
I tried like  host=ABC "Sales Month"== strftime(now(),"%B").&lt;BR /&gt;
But it seems not working.Can anybody help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 07:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199730#M57850</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-03-27T07:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199731#M57851</link>
      <description>&lt;P&gt;Hi SplunkBaby,&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ABC | eval Sales_Month=strftime(now(), "%B") | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will return the field &lt;CODE&gt;Sales_Month&lt;/CODE&gt; as march as of today 03/27/2014.&lt;BR /&gt;
Yes, the field name &lt;CODE&gt;Sales_Month&lt;/CODE&gt; and &lt;CODE&gt;"Sales Month"&lt;/CODE&gt; are the same, because Splunk tends to replace spaces in field names with a &lt;CODE&gt;_&lt;/CODE&gt; .&lt;/P&gt;

&lt;P&gt;hope this helps and thanks for voting &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 07:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199731#M57851</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-27T07:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199732#M57852</link>
      <description>&lt;P&gt;For filtering in the initial search I highly recommend computing the value using an eval-based macro like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[current_month_name]
definition = strftime(time(), "%B")
iseval = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search then becomes this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ABC Sales_Month=`current_month_name`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And Splunk can use its index appropriately, and avoids loading events that don't have that month value.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 08:11:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199732#M57852</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-27T08:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199733#M57853</link>
      <description>&lt;P&gt;this is really a nice approach! have to write it down on the ThingsICanDoBetterNextTime List &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 08:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199733#M57853</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-27T08:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199734#M57854</link>
      <description>&lt;P&gt;Everyone should have such a list &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 11:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199734#M57854</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-27T11:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199735#M57855</link>
      <description>&lt;P&gt;Thanks a a lot.This is  new learning to me and I solved my problem.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 13:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199735#M57855</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-03-27T13:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering in search.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199736#M57856</link>
      <description>&lt;P&gt;Thanks for the support.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 13:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-in-search/m-p/199736#M57856</guid>
      <dc:creator>SplunkBaby</dc:creator>
      <dc:date>2014-03-27T13:09:24Z</dc:date>
    </item>
  </channel>
</rss>

