<?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 How to pass eval value as macro parameter where my search query starts with macro itself in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277840#M83820</link>
    <description>&lt;P&gt;We have created reusable macro  which was used in many reports with 3 parameters and that macro is starting point of query. one parameter takes Month (i.e 02/01/2017 ...) from filter. Now i got requirement where i need to  provide current month/previous month  to macro  as parameter . Since query begins with macro i unable to create eval expression .   &lt;/P&gt;

&lt;P&gt;query:&lt;/P&gt;

&lt;P&gt;|eval month = strftime(now(),"%m/01/%Y") | 'ADForecast("$Domain$,month)'&lt;/P&gt;

&lt;P&gt;since ,we cannot start a query with eval i unable to pass current month. please suggest how to pass current month.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2017 12:09:42 GMT</pubDate>
    <dc:creator>sainadh1247</dc:creator>
    <dc:date>2017-02-06T12:09:42Z</dc:date>
    <item>
      <title>How to pass eval value as macro parameter where my search query starts with macro itself</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277840#M83820</link>
      <description>&lt;P&gt;We have created reusable macro  which was used in many reports with 3 parameters and that macro is starting point of query. one parameter takes Month (i.e 02/01/2017 ...) from filter. Now i got requirement where i need to  provide current month/previous month  to macro  as parameter . Since query begins with macro i unable to create eval expression .   &lt;/P&gt;

&lt;P&gt;query:&lt;/P&gt;

&lt;P&gt;|eval month = strftime(now(),"%m/01/%Y") | 'ADForecast("$Domain$,month)'&lt;/P&gt;

&lt;P&gt;since ,we cannot start a query with eval i unable to pass current month. please suggest how to pass current month.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:09:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277840#M83820</guid>
      <dc:creator>sainadh1247</dc:creator>
      <dc:date>2017-02-06T12:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass eval value as macro parameter where my search query starts with macro itself</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277841#M83821</link>
      <description>&lt;P&gt;Try like this. Assuming you're going to put this query in a dashboard (based on $Domain$ token used), put below query in the panel&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1 | eval month=strftime(now(),"%m/01/%Y") | map search=" 'ADForecast("$Domain$,$$month$$)'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2017 15:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277841#M83821</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-06T15:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass eval value as macro parameter where my search query starts with macro itself</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277842#M83822</link>
      <description>&lt;P&gt;You can either start the search with : &lt;BR /&gt;
search | ...&lt;BR /&gt;
or use&lt;BR /&gt;&lt;BR /&gt;
| makeresults | ...&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 12:52:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-eval-value-as-macro-parameter-where-my-search-query/m-p/277842#M83822</guid>
      <dc:creator>ldongradi_SPL</dc:creator>
      <dc:date>2018-10-30T12:52:07Z</dc:date>
    </item>
  </channel>
</rss>

