<?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: Display Matches Between Query and Lookup File in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313411#M93812</link>
    <description>&lt;P&gt;Hi @cmerriman, thank you for coming back to me with this, but unfortunately it didn't work because it failed to create a filed called "Match", but I have managed to resolve this wuth:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup tellist.csv telno OUTPUT telno as Match
| eval Match=if(isnotnull(Match), "Y", "N") 
| table telno Match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 06:00:08 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2017-04-07T06:00:08Z</dc:date>
    <item>
      <title>Display Matches Between Query and Lookup File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313409#M93810</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please.&lt;/P&gt;

&lt;P&gt;I'm using the following query to successfully return a list of telephone numbers.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`field_wmf(misReceived)`
| fields detail.45BxData
| rex field=detail.Data "dayPhoneNumber\"\:\"(?&amp;lt;day&amp;gt;[^\"]+)\""
| rex field=detail.Data "eveningPhoneNumber\"\:\"(?&amp;lt;evening&amp;gt;[^\"]+)\""
| fillnull value="" day evening
| eval telno=day + ";" + evening
| makemv delim=";" telno
| mvexpand telno
| search telno="07*"
| rex mode=sed field=telno "s/ //g"]
| dedup telno 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I then have a lookup table of telephone numbers which I want to compare against my query. &lt;/P&gt;

&lt;P&gt;Both field names are called tel no, and what I'd like to do is create another column called "Match" which will indicate a match between the query and lookup file by virtue of the letter "Y" but I'm not quite sure about how to go about this.&lt;/P&gt;

&lt;P&gt;I just wondered whether someone could look at this please and offer some guidance on how I can go about about this.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 07:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313409#M93810</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-04-06T07:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display Matches Between Query and Lookup File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313410#M93811</link>
      <description>&lt;P&gt;Reading this, I'd probably go with an append to add in your lookup table, to add the entire table to the bottom. &lt;BR /&gt;
something like this maybe?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; `field_wmf(misReceived)`
 | fields detail.45BxData
 | rex field=detail.Data "dayPhoneNumber\"\:\"(?&amp;lt;day&amp;gt;[^\"]+)\""
 | rex field=detail.Data "eveningPhoneNumber\"\:\"(?&amp;lt;evening&amp;gt;[^\"]+)\""
 | fillnull value="" day evening
 | eval telno=day + ";" + evening
 | makemv delim=";" telno
 | mvexpand telno
 | search telno="07*"
 | rex mode=sed field=telno "s/ //g"]
 | dedup telno 
 |append [inputlookup telno.csv|eval telno1=telno]
 |stats values(*) as * by telno
 |eval Match=if(isnotnull(telno1),"Y",null())
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Apr 2017 14:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313410#M93811</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-04-06T14:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Display Matches Between Query and Lookup File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313411#M93812</link>
      <description>&lt;P&gt;Hi @cmerriman, thank you for coming back to me with this, but unfortunately it didn't work because it failed to create a filed called "Match", but I have managed to resolve this wuth:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup tellist.csv telno OUTPUT telno as Match
| eval Match=if(isnotnull(Match), "Y", "N") 
| table telno Match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 06:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313411#M93812</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-04-07T06:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Display Matches Between Query and Lookup File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313412#M93813</link>
      <description>&lt;P&gt;All,&lt;/P&gt;

&lt;P&gt;I was able to resolve this with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup tellist.csv telno OUTPUT telno as Matched
| eval Matched=if(isnotnull(Matched), "Y", "N") 
| table telno Matched
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Apr 2017 06:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-Matches-Between-Query-and-Lookup-File/m-p/313412#M93813</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-04-07T06:00:38Z</dc:date>
    </item>
  </channel>
</rss>

