<?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 compare a lookup field value with my current search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319608#M95550</link>
    <description>&lt;P&gt;Thanks for your reply but its not giving the right answer . The below did &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="Application" sourcetype=Servers|eval host=lower(host)|eval started_host="T"|append [inputlookup Mylookup|eval started_host="F"]|stats count(eval(started_host=="T")) as started by host|where started == 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Feb 2017 11:52:38 GMT</pubDate>
    <dc:creator>AdixitSplunk</dc:creator>
    <dc:date>2017-02-27T11:52:38Z</dc:date>
    <item>
      <title>How to compare a lookup field value with my current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319606#M95548</link>
      <description>&lt;P&gt;HI All,&lt;BR /&gt;
I have a lookup table with host names value around 10 field name host.&lt;BR /&gt;
I have this search  &lt;CODE&gt;index=Application sourcetype=Servers  |stats count by host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have to compare host in Lookup table with the one in above search and result should give only those host names which are not present in Lookup file.&lt;/P&gt;

&lt;P&gt;Suppose my lookup file has below host names:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host
1
2
3
4 
5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My search gives:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host
1 
4
5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the final result should be :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host
2
3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 10:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319606#M95548</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-02-27T10:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare a lookup field value with my current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319607#M95549</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Application sourcetype=Servers
| search [|inputlookup yourLookup | fields + host | table host] 
| stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Feb 2017 11:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319607#M95549</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2017-02-27T11:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare a lookup field value with my current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319608#M95550</link>
      <description>&lt;P&gt;Thanks for your reply but its not giving the right answer . The below did &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="Application" sourcetype=Servers|eval host=lower(host)|eval started_host="T"|append [inputlookup Mylookup|eval started_host="F"]|stats count(eval(started_host=="T")) as started by host|where started == 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Feb 2017 11:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319608#M95550</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-02-27T11:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare a lookup field value with my current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319609#M95551</link>
      <description>&lt;P&gt;@AdixitSplunk - Did your above comment provide a working solution to your question? If yes and you would like to close out your post, please let me know so I can convert it to an Answer to be accepted. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319609#M95551</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-02-27T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare a lookup field value with my current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319610#M95552</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Application sourcetype=Servers | stats count by host | appendpipe [|inputlookup hostLookup | table host | eval sourcetype="LOOKUP"] | stats values(*) AS * dc(sourcetype) AS numDatasets BY host | search numDatasets=1 AND sourcetype="LOOKUP" | table host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Feb 2017 21:43:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-a-lookup-field-value-with-my-current-search/m-p/319610#M95552</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-28T21:43:17Z</dc:date>
    </item>
  </channel>
</rss>

