<?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: Using a lookup file in a subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247045#M73665</link>
    <description>&lt;P&gt;After further troubleshooting, I noticed "| inputlookup UCMDB.csv where MD="Ken Bell" | rename "Server Name" as host_name | fields host_name" works fine but when I add the "| eval host_name = host_name" section the search returns no values in the fields.&lt;BR /&gt;
I think the problem is with the eval function. Any ideas?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:05:50 GMT</pubDate>
    <dc:creator>Makinde</dc:creator>
    <dc:date>2020-09-29T09:05:50Z</dc:date>
    <item>
      <title>Using a lookup file in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247042#M73662</link>
      <description>&lt;P&gt;I have an original search to identify some vulnerabilities in my network, one of the fields in the search string is the Server_name field, however I want it to pull that information from my lookup file, so I am going to have to do a search in a search.&lt;/P&gt;

&lt;P&gt;One challenge I have is my server names in Splunk are the FQDN but the server_name in my lookup file is just the server name not the FQDN so for me to get a match I need to use a wildcard (*) i.e. Server_name in Splunk is WLTYZ.domain.com while the server name in the lookup file is WLTYZ but I need my search string to match WLTYZ.domain.com in the search results when it uses the result WLTYZ from the lookup file.&lt;/P&gt;

&lt;P&gt;I am thinking of putting the wildcard before and after the lookup search string so my search string looks like this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main host_name=*[| inputlookup UCMDB.csv where MD="Ken Bell" | table "Server Name"]* | dedup host_name, qid | stats count by host_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do you think this will work? If not what would you recommend?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247042#M73662</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2020-09-29T09:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247043#M73663</link>
      <description>&lt;P&gt;That's not how filtering by subsearch results work. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main [inputlookup UCMDB.csv where MD="Ken Bell" | rename "Server Name" as host_name | fields host_name | eval host_name = host_name."*"] | stats dc(qid) by host_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, I've only added the asterisk to the end because of how you described the FQDN difference - wildcards at the beginning of search terms are terribly inefficient. I've also replaced the &lt;CODE&gt;dedup | stats count&lt;/CODE&gt; with a &lt;CODE&gt;stats dc()&lt;/CODE&gt;, should do the same thing but faster.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 17:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247043#M73663</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-13T17:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247044#M73664</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;

&lt;P&gt;I tried the search string you suggested, it wasn't working so I started troubleshooting&lt;BR /&gt;
First let's start with FQDN with no difference so I removed the "*" just to simplify it all.&lt;BR /&gt;
First I was able to confirm inputlookup UCMDB.csv where MD="Ken Bell" | rename "Server Name" as host_name | fields host_name works fine, but when I put it all in the search it isn't working.&lt;BR /&gt;
I confirmed the hostname returneddoes exist in the index so logically it should work however I can't see any results when I run the search.&lt;BR /&gt;
Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247044#M73664</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2020-09-29T09:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247045#M73665</link>
      <description>&lt;P&gt;After further troubleshooting, I noticed "| inputlookup UCMDB.csv where MD="Ken Bell" | rename "Server Name" as host_name | fields host_name" works fine but when I add the "| eval host_name = host_name" section the search returns no values in the fields.&lt;BR /&gt;
I think the problem is with the eval function. Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247045#M73665</guid>
      <dc:creator>Makinde</dc:creator>
      <dc:date>2020-09-29T09:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup file in a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247046#M73666</link>
      <description>&lt;P&gt;To troubleshoot, split the search into two parts. First, run this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup UCMDB.csv where MD="Ken Bell" | rename "Server Name" as host_name | fields host_name | eval host_name = host_name."*" | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result should be a list of &lt;CODE&gt;host_name="foo*"&lt;/CODE&gt; filters concatenated with a bunch of parentheses and &lt;CODE&gt;OR&lt;/CODE&gt;s. If that list looks okay, copy it into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main PASTEHERE | stats dc(qid) by host_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Mar 2016 21:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-file-in-a-subsearch/m-p/247046#M73666</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-13T21:25:19Z</dc:date>
    </item>
  </channel>
</rss>

