<?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: Help with Splunk search query and Lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425080#M121876</link>
    <description>&lt;P&gt;Hi Shashank_87,&lt;BR /&gt;
to not use join is a good idea!&lt;BR /&gt;
in fact you don't need to use join command with a lookup because the lookup command is a join!&lt;BR /&gt;
so you could try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test sourcetype=sales_log getProdDetails "soap response" 
| rex field=_raw "=(?[^\|]+)" 
| rex field=_raw "identifier&amp;gt;(?[^\&amp;lt;]+)" max_match=200 
| eval productIdentifierNew = mvfilter(productIdentifier LIKE "D%") 
| mvexpand productIdentifierNew 
| lookup productIdentifier.csv productIdentifier AS productIdentifierNew OUTPUT interesting fields
| table ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2019 09:31:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-08-02T09:31:16Z</dc:date>
    <item>
      <title>Help with Splunk search query and Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425079#M121875</link>
      <description>&lt;P&gt;Hi, I am struggling to form my search query along with lookup. So the scenarios is like this -&lt;BR /&gt;
I have a search query which gets a web service response in which there is a tag "identifier" and this tags occurs multiple times in the same event with values like like P123456, D123465 etc.&lt;BR /&gt;
On other side I have a lookup which contains some of these identifiers (only D*). Now I only want to retrieve those UNIQUE events which matches any of the identifier from the lookup.&lt;BR /&gt;
I have written a query but not sure if that is correct (don't want to use join) and if someone can help me with a better search that would be highly appreciated.&lt;/P&gt;

&lt;P&gt;index=test sourcetype=sales_log getProdDetails "soap response" &lt;BR /&gt;
| rex field=_raw "=(?[^|]+)" &lt;BR /&gt;
| rex field=_raw "identifier&amp;gt;(?[^&amp;lt;]+)" max_match=200 &lt;BR /&gt;
| eval productIdentifierNew = mvfilter(productIdentifier LIKE "D%") &lt;BR /&gt;
| mvexpand productIdentifierNew &lt;BR /&gt;
| join productIdentifierNew max=0 &lt;BR /&gt;
    [| inputlookup productIdentifier.csv &lt;BR /&gt;
    | rename productIdentifier as productIdentifierNew]&lt;/P&gt;

&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:35:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425079#M121875</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2020-09-30T01:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Splunk search query and Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425080#M121876</link>
      <description>&lt;P&gt;Hi Shashank_87,&lt;BR /&gt;
to not use join is a good idea!&lt;BR /&gt;
in fact you don't need to use join command with a lookup because the lookup command is a join!&lt;BR /&gt;
so you could try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test sourcetype=sales_log getProdDetails "soap response" 
| rex field=_raw "=(?[^\|]+)" 
| rex field=_raw "identifier&amp;gt;(?[^\&amp;lt;]+)" max_match=200 
| eval productIdentifierNew = mvfilter(productIdentifier LIKE "D%") 
| mvexpand productIdentifierNew 
| lookup productIdentifier.csv productIdentifier AS productIdentifierNew OUTPUT interesting fields
| table ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 09:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425080#M121876</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-08-02T09:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Splunk search query and Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425081#M121877</link>
      <description>&lt;P&gt;@gcusello &lt;BR /&gt;
Hi Giuseppe, Thanks for your swift response. I tried using lookup command but what should i be putting in the interesting fields? So my lookup only contains one field "productIdentifier" and fields I want is uniqueID which is present in the events so that I can dedup it afterwards to get the unique events.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 10:08:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425081#M121877</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2019-08-02T10:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Splunk search query and Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425082#M121878</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test sourcetype=sales_log getProdDetails "soap response" 
| rex field=_raw "identifier&amp;gt;(?&amp;lt;productIdentifierNew&amp;gt;D[^\&amp;lt;]+)" max_match=200 
| lookup productIdentifier productIdentifierNew OUTPUT productIdentifier AS KeepMe
| where isnotnull(KeepMe)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Aug 2019 00:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Splunk-search-query-and-Lookup/m-p/425082#M121878</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-06T00:21:02Z</dc:date>
    </item>
  </channel>
</rss>

