<?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: Conditional Macros in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Macros/m-p/194853#M56201</link>
    <description>&lt;P&gt;Hi vganjare,&lt;/P&gt;

&lt;P&gt;no, I think it is still not possible, but you can build an eval based macro &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Search/Usesearchmacros"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/Search/Usesearchmacros&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if($arg1$=="condition","true","false")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2015 12:16:45 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2015-01-16T12:16:45Z</dc:date>
    <item>
      <title>Conditional Macros</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Macros/m-p/194852#M56200</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to dynamically include macros in search depending on the eval statements. I want to acheive something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; .... | eval temp = if (condition, macro1, macro2) | further processing.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to achieve in Splunk?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Vishal&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Macros/m-p/194852#M56200</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-01-16T11:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Macros</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Macros/m-p/194853#M56201</link>
      <description>&lt;P&gt;Hi vganjare,&lt;/P&gt;

&lt;P&gt;no, I think it is still not possible, but you can build an eval based macro &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Search/Usesearchmacros"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/Search/Usesearchmacros&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if($arg1$=="condition","true","false")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 12:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Macros/m-p/194853#M56201</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-01-16T12:16:45Z</dc:date>
    </item>
  </channel>
</rss>

