<?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: Passing a lookup file name as a parameter in a macro in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551387#M156475</link>
    <description>&lt;P&gt;I haven't used map much in the past, so didn't think of it. Thanks for the reminder! Had to set the 'maxsearches' option so that I didn't hit the default limit of 10. And did a '| search blarg' in the map subsearch pipeline just to make sure the results set was cleared out before going on to the next one (not necessary, just a sanity check). Worked well, but NOT recommended if you have 1,000's of lookups all at a HUGE size - I/O spike!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Otherwise, works quite well for this limited sync use case. Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 12 May 2021 18:34:25 GMT</pubDate>
    <dc:creator>pgreer_splunk</dc:creator>
    <dc:date>2021-05-12T18:34:25Z</dc:date>
    <item>
      <title>Passing a lookup file name as a parameter in a macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551276#M156433</link>
      <description>&lt;P&gt;I have a use case where there are over 50+ lookup files that I need to 'sync' between one app context and another. The idea is to:&lt;BR /&gt;1) read the lookup from context of App1 search bar&lt;BR /&gt;2) outputlookup to a lookup file named 'UPDATE_&amp;lt;lookupname&amp;gt;.csv' that resides in App2 context&lt;BR /&gt;&lt;BR /&gt;The idea is to have the 50+ lookup file names in a lookup named myLookupFiles with App1. Then pass that filename as a field into a macro. So the gist would be to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup myLookupFiles
| `mySyncMacro(myLookupFileNameField)`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the macro would thus then be something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;join type=left max=0
[| inputlookup $myLookupFileName$]
| fields - myLookupFileNameField
| outputlookup createinapp=true UPDATE_$myLookupFileName$
| search blarg&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which, of course, doesn't work.&lt;BR /&gt;&lt;BR /&gt;Thoughts on a way to iterate across all 50+ file names when they are specified as values within a table to create the 50+ named lookup files with the name "UPDATE_&amp;lt;lookupname&amp;gt;.csv"?&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 18:31:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551276#M156433</guid>
      <dc:creator>pgreer_splunk</dc:creator>
      <dc:date>2021-05-11T18:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a lookup file name as a parameter in a macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551296#M156441</link>
      <description>&lt;P&gt;what about map?&amp;nbsp; Just a simple example here, but should give you the idea I think.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup myLookupFiles
| map search="| inputlookup $filenamefield$ | outputlookup UPDATE_$filenamefield$"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 00:45:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551296#M156441</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2021-05-12T00:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a lookup file name as a parameter in a macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551387#M156475</link>
      <description>&lt;P&gt;I haven't used map much in the past, so didn't think of it. Thanks for the reminder! Had to set the 'maxsearches' option so that I didn't hit the default limit of 10. And did a '| search blarg' in the map subsearch pipeline just to make sure the results set was cleared out before going on to the next one (not necessary, just a sanity check). Worked well, but NOT recommended if you have 1,000's of lookups all at a HUGE size - I/O spike!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Otherwise, works quite well for this limited sync use case. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 18:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-a-lookup-file-name-as-a-parameter-in-a-macro/m-p/551387#M156475</guid>
      <dc:creator>pgreer_splunk</dc:creator>
      <dc:date>2021-05-12T18:34:25Z</dc:date>
    </item>
  </channel>
</rss>

