<?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 do Lookup single field comparison? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445581#M126393</link>
    <description>&lt;P&gt;Hi harsmarvania57&lt;/P&gt;

&lt;P&gt;Thanks for the answer )&lt;/P&gt;

&lt;P&gt;This is an imaginary &lt;CODE&gt;ip&lt;/CODE&gt; field from the list &lt;CODE&gt;blacklist_get.csv&lt;/CODE&gt; = Column1 &lt;BR /&gt;
Column1 )) &lt;BR /&gt;
Yes, I did not rename anything when I created the list ))&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=......
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get.csv Column1 as IP OUTPUT Column1 as Column1
| where isnull(Column1)
| table IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did not think that after &lt;CODE&gt;OUTPUT&lt;/CODE&gt;  you need to specify the same field = &lt;CODE&gt;Column1 as Column1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Tell me how to expand the query so that this new IP one is added to the same sheet blacklist_get ?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2019 16:52:10 GMT</pubDate>
    <dc:creator>Aleksey_18</dc:creator>
    <dc:date>2019-03-20T16:52:10Z</dc:date>
    <item>
      <title>How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445579#M126391</link>
      <description>&lt;P&gt;I apologize for the banal question on the lookup.&lt;BR /&gt;
Not so long ago, I began to learn how to filter events by lists through lookup.&lt;BR /&gt;
The task of comparing a couple of fields )) but it is not clear how to solve.&lt;/P&gt;

&lt;P&gt;There is a search (input restype), the result of which gives a JSON format event with a field ( result{} ) containing IP.&lt;BR /&gt;
This field should be compared with the list lookup ip ( blacklist_get ) that I have already created.&lt;BR /&gt;
The result of the query should be output IP that are not in the list blacklist_get .&lt;BR /&gt;
Attached a screenshot with the events of this field with IP&lt;IMG src="https://community.splunk.com/storage/temp/271647-scr1-field.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;In the query itself, I do a conversion with a field result{} as it contains (JSON) many values, then I give this field a new name IP.&lt;BR /&gt;
The request works correctly, but how to filter through the lists is unclear.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=.........
| spath input=result{} | mvexpand result{}
| rename result{} as IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445579#M126391</guid>
      <dc:creator>Aleksey_18</dc:creator>
      <dc:date>2020-09-29T23:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445580#M126392</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Here I am assuming that you have column header &lt;CODE&gt;ip&lt;/CODE&gt; in your blacklist_get.csv file. In that case try below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=.........
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get.csv ip as IP OUTPUT ip as lookup_ip
| where isnull(lookup_ip)
| table IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 15:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445580#M126392</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-03-20T15:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445581#M126393</link>
      <description>&lt;P&gt;Hi harsmarvania57&lt;/P&gt;

&lt;P&gt;Thanks for the answer )&lt;/P&gt;

&lt;P&gt;This is an imaginary &lt;CODE&gt;ip&lt;/CODE&gt; field from the list &lt;CODE&gt;blacklist_get.csv&lt;/CODE&gt; = Column1 &lt;BR /&gt;
Column1 )) &lt;BR /&gt;
Yes, I did not rename anything when I created the list ))&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=......
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get.csv Column1 as IP OUTPUT Column1 as Column1
| where isnull(Column1)
| table IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did not think that after &lt;CODE&gt;OUTPUT&lt;/CODE&gt;  you need to specify the same field = &lt;CODE&gt;Column1 as Column1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Tell me how to expand the query so that this new IP one is added to the same sheet blacklist_get ?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 16:52:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445581#M126393</guid>
      <dc:creator>Aleksey_18</dc:creator>
      <dc:date>2019-03-20T16:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445582#M126394</link>
      <description>&lt;P&gt;If you want to append these IP into blacklist_get.csv then use below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=......
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get.csv Column1 as IP OUTPUT Column1 as Column1
| where isnull(Column1)
| table IP
| outputlookup append=t blacklist_get.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 17:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445582#M126394</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-03-20T17:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445583#M126395</link>
      <description>&lt;P&gt;Hi  @harsmarvania57 &lt;/P&gt;

&lt;P&gt;thanks again&lt;/P&gt;

&lt;P&gt;Tell me what's wrong with me again.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype="..........."
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get Column1 as IP OUTPUT Column1 as Column1
| where isnull(Column1)
| table IP
| outputlookup append=true blacklist_get
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;An error occurs&lt;/P&gt;

&lt;P&gt;Error in 'outputlookup' command: Could not append to file 'blacklist_get': Cannot append to file because none of the fields match.&lt;/P&gt;

&lt;P&gt;I tried to determine the field Column1&lt;/P&gt;

&lt;P&gt;| fields Column1 | outputlookup append=true blacklist_get&lt;BR /&gt;
Also does not work&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 11:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445583#M126395</guid>
      <dc:creator>Aleksey_18</dc:creator>
      <dc:date>2019-03-21T11:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445584#M126396</link>
      <description>&lt;P&gt;Ah my bad, try below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" sourcetype=......
| spath input=result{} | mvexpand result{}
| rename result{} as IP
| lookup blacklist_get.csv Column1 as IP OUTPUT Column1 as lkp_Column1
| where isnull(lkp_Column1)
| rename IP as Column1
| table Column1
| outputlookup append=t blacklist_get.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2019 11:35:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445584#M126396</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-03-21T11:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Lookup single field comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445585#M126397</link>
      <description>&lt;P&gt;hi @harsmarvania57 &lt;BR /&gt;
Tell me, how will the team overwrite the list when getting a new value?&lt;BR /&gt;
A new IP identified and listed in the list of overwriting the previous data in the list to this.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 14:38:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Lookup-single-field-comparison/m-p/445585#M126397</guid>
      <dc:creator>Aleksey_18</dc:creator>
      <dc:date>2019-03-26T14:38:13Z</dc:date>
    </item>
  </channel>
</rss>

