<?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 indexes from a macro to another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508457#M142070</link>
    <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;I am using &lt;STRONG&gt;makeresults&lt;/STRONG&gt; command to create a macro like below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| `get_indexes_by_args(1)`&lt;/LI-CODE&gt;&lt;P&gt;And the macro will return the string like below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("apps", "_apps")&lt;/LI-CODE&gt;&lt;P&gt;Now I want to pass this macro to another macro. How can I solve it? It will be like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| `get_indexes_by_args("app")` "/api/" | ....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 08:05:54 GMT</pubDate>
    <dc:creator>thinhdinh</dc:creator>
    <dc:date>2020-07-10T08:05:54Z</dc:date>
    <item>
      <title>How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508457#M142070</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;I am using &lt;STRONG&gt;makeresults&lt;/STRONG&gt; command to create a macro like below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| `get_indexes_by_args(1)`&lt;/LI-CODE&gt;&lt;P&gt;And the macro will return the string like below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("apps", "_apps")&lt;/LI-CODE&gt;&lt;P&gt;Now I want to pass this macro to another macro. How can I solve it? It will be like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| `get_indexes_by_args("app")` "/api/" | ....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 08:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508457#M142070</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-07-10T08:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508476#M142072</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;macro can contain another macro, so write it just like first one.&lt;/P&gt;&lt;P&gt;`macro1(1)` which then contains `get_indexes_by_args(1)`&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508476#M142072</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-10T12:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508803#M142149</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;Thank you for replying, but I still don't get it. So in the second macro I write like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`get_indexes_by_args($index$)`....|&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And then in the search bar I write the query like below&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| `the_second_macro(...)`&lt;/LI-CODE&gt;&lt;P&gt;And it is not working. Could you show me where I was wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 12:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508803#M142149</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-07-13T12:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508833#M142157</link>
      <description>&lt;P&gt;1st macro&amp;nbsp;&lt;/P&gt;&lt;P&gt;macro1(1)&lt;/P&gt;&lt;P&gt;sourcetype=$st$&lt;/P&gt;&lt;P&gt;parameter named as st&lt;/P&gt;&lt;P&gt;2nd macro&lt;/P&gt;&lt;P&gt;macro2(1)&lt;/P&gt;&lt;P&gt;`macro1($st$)`&lt;/P&gt;&lt;P&gt;parameter as st&lt;/P&gt;&lt;P&gt;call it as&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=_internal `macro2(splunkd)`&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 15:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508833#M142157</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-13T15:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508904#M142177</link>
      <description>If this solve your issue, please accept it as solution so other people also known it.</description>
      <pubDate>Mon, 13 Jul 2020 20:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/508904#M142177</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-13T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/509500#M142392</link>
      <description>&lt;P&gt;To be honestly I still don't get it works, but I just accepted it as solution. Hope someone can get your idea. Cause I mentioned above, inside the first macro I use &lt;STRONG&gt;makeresults&lt;/STRONG&gt; command to returned flexible indexes and I think maybe I did something wrong here. By the way I knew how to use a macro inside another macro, cause I have another one on my local splunk and it works well. Anyway thanks for your helps.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 11:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/509500#M142392</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-07-16T11:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass indexes from a macro to another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/509579#M142427</link>
      <description>&lt;P&gt;Ok, can you show your macros.conf, so we can look if we found solution to you?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 19:11:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-indexes-from-a-macro-to-another-search/m-p/509579#M142427</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-16T19:11:59Z</dc:date>
    </item>
  </channel>
</rss>

