<?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 lookup file contents as individual search strings in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678742#M232076</link>
    <description>&lt;P&gt;Further, looking at the job I see this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;litsearch (index=index1 (tenant="tenant1xxx" OR tenant="tenant2xxx" OR tenant="tenant3xxx" OR tenant="tenant4xxx") (splunk_server::splkindx* | fields  keepcolorder=t "*" "_bkt" "_cd" "_si" "host" "index" "linecount" "source" "sourcetype" "splunk_server" "new_field"&lt;/LI-CODE&gt;&lt;P&gt;which is almost what I want.&amp;nbsp; Again, the tenant field does not exist in the original index, I am looking for the explicit string "tenant1xxx" etc.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 00:52:03 GMT</pubDate>
    <dc:creator>deepdive100</dc:creator>
    <dc:date>2024-02-27T00:52:03Z</dc:date>
    <item>
      <title>Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678725#M232065</link>
      <description>&lt;P&gt;Lookup file `tenants.csv`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tenant,
tenant1,
tenant2,
tenant3,
tenant4,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 (tenant1xxx OR tenant2xxx OR tenant3xxx OR tenant4xxx)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a tough time getting this work.&amp;nbsp; Trying lookup is not working because I am not searching any existing fields.&amp;nbsp; Subsearching with inputlookup is not working at all, not sure why.&lt;BR /&gt;So in a nutshell, I'm trying to inject (not just each value from the lookup file but also appending `xxx`), as an OR list of raw strings.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 21:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678725#M232065</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-26T21:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678730#M232070</link>
      <description>&lt;P&gt;You were close.&lt;/P&gt;&lt;PRE&gt;index=whatever [ | inputlookup lookup.csv&lt;BR /&gt;| eval search=tenant."xxx"&lt;BR /&gt;| table search ]&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 07:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678730#M232070</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-02-27T07:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678737#M232073</link>
      <description>&lt;P&gt;Don't forget to close subsearch &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;nbsp;Here is an alternative to save a command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=whatever [ | inputlookup lookup.csv
| stats values(eval(tenant."xxx")) as search]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 00:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678737#M232073</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-27T00:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678740#M232075</link>
      <description>&lt;P&gt;This is returning 0 results.&lt;/P&gt;&lt;P&gt;I've checked the permissions and availability of the lookup file, all good.&lt;/P&gt;&lt;P&gt;I've run the desired query explicitly, and it returns many results.&lt;/P&gt;&lt;P&gt;Even this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 [ | inputlookup tenants.csv
| eval new_field=tenant ```&amp;lt;--- forgoing the append```
| table new_field]&lt;/LI-CODE&gt;&lt;P&gt;is not returning anything.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 00:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678740#M232075</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T00:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678742#M232076</link>
      <description>&lt;P&gt;Further, looking at the job I see this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;litsearch (index=index1 (tenant="tenant1xxx" OR tenant="tenant2xxx" OR tenant="tenant3xxx" OR tenant="tenant4xxx") (splunk_server::splkindx* | fields  keepcolorder=t "*" "_bkt" "_cd" "_si" "host" "index" "linecount" "source" "sourcetype" "splunk_server" "new_field"&lt;/LI-CODE&gt;&lt;P&gt;which is almost what I want.&amp;nbsp; Again, the tenant field does not exist in the original index, I am looking for the explicit string "tenant1xxx" etc.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 00:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678742#M232076</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T00:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678744#M232078</link>
      <description>&lt;P&gt;You did not get essence of&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;'s solution. &amp;nbsp;In subsearch (weirdly enough but documented nontheless), meta-keyword &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt;&amp;nbsp;has a special meaning. &amp;nbsp;You cannot replace it with any other string. (Actually, t here is ONE synonym:-) &amp;nbsp;But&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;forgot to close subsearch. &amp;nbsp;See explanation in my &lt;A href="https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678737/highlight/true#M232073" target="_self"&gt;alternative&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678744#M232078</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-27T01:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678745#M232079</link>
      <description>&lt;P&gt;OK, I found a different thread and can see that I have to use "search" in the eval.&amp;nbsp; Awesome.&amp;nbsp; But now instead of getting '(tenant1xxx OR tenant2xxx OR...)' I am only getting tenant1xxx&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678745#M232079</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T01:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678746#M232080</link>
      <description>&lt;P&gt;Yeah I tried your too, no dice.&amp;nbsp; I missed your reply here, but if you look above I am now adding the meta search to the subsearch.&amp;nbsp; The issue is that it is only adding the first lookup value&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:15:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678746#M232080</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T01:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678747#M232081</link>
      <description>&lt;P&gt;To diagnose, run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup.csv
| stats values(eval(tenant."xxx")) as search
| format&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives you the exact string passed to main search.&lt;/P&gt;&lt;P&gt;Alternatively, run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup.csv
| fields tenant
| eval search = tenant."xxx"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way, you can see line by line substitution. &amp;nbsp;If not, you need to post output of this diagnostic. (Anonymize as needed but must reproduce structure/characteristics precisely.)&lt;/P&gt;&lt;P&gt;Then, test&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup.csv
| fields tenant
| eval search = tenant."xxx"
| format&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678747#M232081</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-27T01:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678748#M232082</link>
      <description>&lt;P&gt;Ahhhhh got it, when i added [| format] it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm just now seeing your suggestion&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;,&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678748#M232082</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T01:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678749#M232083</link>
      <description>&lt;P&gt;well, now I have a new issue.&amp;nbsp; Since the tenant field is changed over to 'search', how can I stats by tenant?&amp;nbsp; Do i just use the lookup file again?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678749#M232083</guid>
      <dc:creator>deepdive100</dc:creator>
      <dc:date>2024-02-27T01:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678751#M232084</link>
      <description>&lt;P&gt;One problem at a time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Your ask was free-hand search without matching specific field name. &amp;nbsp;It is perhaps best to close this one and post another question with the need to extract freehand strings based on lookup values? &amp;nbsp;These are very different search techniques. &amp;nbsp;You will need to explain your lookup AND event data more specifically than mock values tenant1 tenant2 tenant3 and xxx. &amp;nbsp;In particular, what does appended "xxx" signify? &amp;nbsp;How would they appear in event data? &amp;nbsp;(Anonymize, but be specific enough for volunteers without intimate knowledge about your data to be helpful.)&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 01:35:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678751#M232084</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-02-27T01:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Passing lookup file contents as individual search strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678772#M232087</link>
      <description>&lt;P&gt;Copy-pasted and missed that closing one. Good catch.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 07:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-lookup-file-contents-as-individual-search-strings/m-p/678772#M232087</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-02-27T07:18:06Z</dc:date>
    </item>
  </channel>
</rss>

