<?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 compare output of a search to a lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492092#M194282</link>
    <description>&lt;P&gt;Hello , &lt;/P&gt;

&lt;P&gt;I have a csv lookup file that contains all Oracle services, at the same time I have a search that gives me the active services now, I need to know what the service is missing in the result of search on comparison by the csv files.&lt;/P&gt;

&lt;P&gt;Any help please? &lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 11:53:15 GMT</pubDate>
    <dc:creator>aalaa</dc:creator>
    <dc:date>2019-10-02T11:53:15Z</dc:date>
    <item>
      <title>compare output of a search to a lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492092#M194282</link>
      <description>&lt;P&gt;Hello , &lt;/P&gt;

&lt;P&gt;I have a csv lookup file that contains all Oracle services, at the same time I have a search that gives me the active services now, I need to know what the service is missing in the result of search on comparison by the csv files.&lt;/P&gt;

&lt;P&gt;Any help please? &lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 11:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492092#M194282</guid>
      <dc:creator>aalaa</dc:creator>
      <dc:date>2019-10-02T11:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: compare output of a search to a lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492093#M194283</link>
      <description>&lt;P&gt;Hi aalaa,&lt;BR /&gt;
if the field is called "service" both in index and in lookup, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index
| eval service=lower(service)
| stats count BY service
| append [ | inputlookup Oracle_services.csv | eval count=0, service=lower(service) | fields count service ]
| stats sum(count) AS Total BY service
| where Total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way you have al the missing services.&lt;/P&gt;

&lt;P&gt;If you want to list all the services displayng status, you have to replace the last row with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Status=if(Total=o,"Missing","Present")
| table service Status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 12:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492093#M194283</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-02T12:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: compare output of a search to a lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492094#M194284</link>
      <description>&lt;P&gt;This search return the list of service in the csv file : &lt;/P&gt;

&lt;P&gt;index=my_index&lt;BR /&gt;
 | eval service=lower(service)&lt;BR /&gt;
 | stats count BY service&lt;BR /&gt;
 | append [ | inputlookup Oracle_services.csv | eval count=0, service=lower(service) | fields count service ]&lt;BR /&gt;
 | stats sum(count) AS Total BY service&lt;BR /&gt;
 | eval Status=if(Total=o,"Missing","Present")&lt;BR /&gt;
 | table service Status&lt;/P&gt;

&lt;P&gt;I want to display the name of  service that not actif now &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492094#M194284</guid>
      <dc:creator>aalaa</dc:creator>
      <dc:date>2020-09-30T02:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: compare output of a search to a lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492095#M194285</link>
      <description>&lt;P&gt;Hi aalaa,&lt;BR /&gt;
to display the list of not active services, you have to use the first choice (the one with &lt;CODE&gt;| where Total=0&lt;/CODE&gt; ) because the condition to identify not present services is that these services are in the lookup table (count=0) but not in the index (count&amp;gt;0).&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-output-of-a-search-to-a-lookup-file/m-p/492095#M194285</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-02T15:26:44Z</dc:date>
    </item>
  </channel>
</rss>

