<?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: How to dynamically append the content of multiple lookup files? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415246#M119563</link>
    <description>&lt;P&gt;Hi Folks.. &lt;/P&gt;

&lt;P&gt;I have a similar requirement wherein I want the name of the lookup file to be print against the data from each of them in the following way. For some reason, the eval function is not giving the desired output. Can anyone help ?&lt;/P&gt;

&lt;P&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local"&lt;BR /&gt;
 | search title="geo_attr*.csv"&lt;BR /&gt;
 | map search="eval lkpnm=$title$ |inputlookup $title$ | stats dc(title) as Count | table lkpnm, Count"&lt;/P&gt;

&lt;P&gt;This is giving me the correct count, but not the lookupname!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:47:07 GMT</pubDate>
    <dc:creator>swetvenk</dc:creator>
    <dc:date>2020-09-30T03:47:07Z</dc:date>
    <item>
      <title>How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415242#M119559</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;

&lt;P&gt;I am trying to dynamically append the content of multiple lookup files but I am not sure it is possible.&lt;/P&gt;

&lt;P&gt;Here how I do for now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup geo_attr_countries.csv
| inputlookup append=true geo_attr_us_states.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is working fine but I was wondering if I could build that search without having to explicitly list lookup files.&lt;/P&gt;

&lt;P&gt;I can build a search to retrieve the lookups:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local"
| search title="geo_attr*.csv"
| fields title
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;geo_attr_countries.csv &lt;BR /&gt;
geo_attr_us_states.csv&lt;/P&gt;

&lt;P&gt;But I do not see how I can use this to build the search.&lt;/P&gt;

&lt;P&gt;I was thinking of something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local"
| search title="geo_attr*.csv"
| fields title
| foreach title [| inputlookup append=true &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I would get this error: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'foreach' command: Search pipeline may not contain non-streaming commands.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I am stuck, any idea on how to achieve this?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415242#M119559</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-09-30T00:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415243#M119560</link>
      <description>&lt;P&gt;Have you tried the same with | outputlookup append=true &amp;lt;&amp;gt; ?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2019 00:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415243#M119560</guid>
      <dc:creator>MikeElliott</dc:creator>
      <dc:date>2019-04-14T00:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415244#M119561</link>
      <description>&lt;P&gt;You can do this using the map function.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local"
| search title="geo_attr*.csv"
| map search="|inputlookup $title$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Apr 2019 03:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415244#M119561</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-04-14T03:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415245#M119562</link>
      <description>&lt;P&gt;Damn, I did not know about this command, does it perfectly well!&lt;/P&gt;

&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2019 05:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415245#M119562</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2019-04-14T05:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415246#M119563</link>
      <description>&lt;P&gt;Hi Folks.. &lt;/P&gt;

&lt;P&gt;I have a similar requirement wherein I want the name of the lookup file to be print against the data from each of them in the following way. For some reason, the eval function is not giving the desired output. Can anyone help ?&lt;/P&gt;

&lt;P&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local"&lt;BR /&gt;
 | search title="geo_attr*.csv"&lt;BR /&gt;
 | map search="eval lkpnm=$title$ |inputlookup $title$ | stats dc(title) as Count | table lkpnm, Count"&lt;/P&gt;

&lt;P&gt;This is giving me the correct count, but not the lookupname!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415246#M119563</guid>
      <dc:creator>swetvenk</dc:creator>
      <dc:date>2020-09-30T03:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically append the content of multiple lookup files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415247#M119564</link>
      <description>&lt;P&gt;Hi @swetvenk, I would do something like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/search/data/lookup-table-files splunk_server="local" 
| search title="geo_attr*.csv" 
| map search="| makeresults | eval lkpnm=$title$ | append [| inputlookup $title$]| eventstats last(lkpnm) as lkpnm | search NOT _time="*""
| stats count by lkpnm
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Feb 2020 11:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-append-the-content-of-multiple-lookup-files/m-p/415247#M119564</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-02-04T11:47:49Z</dc:date>
    </item>
  </channel>
</rss>

