<?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: compare query result with lookup result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613864#M213329</link>
    <description>&lt;P&gt;In the join subsearch, 'expand' the events like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| join savedsearch_name [
  | rest splunk_server=local count=0 /services/saved/searches 
  | rename title as savedsearch_name 
  | mvexpand "action.email.to"
  | lookup mailingList.csv "action.email.to" OUTPUT teamName
  | table action.email.to savedsearch_name teamName]&lt;/LI-CODE&gt;&lt;P&gt;the mvexpand will split out the multi-value field and create a new event with all the other fields intact for each value of the multi-value field.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2022 23:40:38 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-09-20T23:40:38Z</dc:date>
    <item>
      <title>How do I compare query result with lookup result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613610#M213267</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have a query that running a rest command, one of the fields is "action.email.to"&lt;BR /&gt;also i have a lookup table with action.email.to list and team name for east email in the list&lt;BR /&gt;I want to compare the action.email.to from the query with the one from the lookup and add another column with the team name.&lt;/P&gt;
&lt;P&gt;I tried with append but the team name column is empty&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is my query :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|rest /servicesNS/admin/search/alerts/fired_alerts/- |fields eai:acl.owner  savedsearch_name triggered_alert_count | join savedsearch_name [| rest splunk_server=local count=0 /services/saved/searches | rename title as savedsearch_name |append [inputlookup mailingList.csv ] | table action.email.to savedsearch_name teamName]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613610#M213267</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2022-09-19T15:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613614#M213269</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;inputlookup &lt;/FONT&gt;is an oft-misused command.&amp;nbsp; To map an email address to a team name in a lookup file, use the &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rest /servicesNS/admin/search/alerts/fired_alerts/- 
|fields eai:acl.owner  savedsearch_name triggered_alert_count 
| join savedsearch_name [
  | rest splunk_server=local count=0 /services/saved/searches 
  | rename title as savedsearch_name 
  | lookup mailingList.csv "action.email.to" OUTPUT teamName
  | table action.email.to savedsearch_name teamName]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613614#M213269</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-09-19T14:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613759#M213309</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;it looks good&lt;BR /&gt;But i have one issue&lt;/P&gt;&lt;P&gt;i get some of the results in action.email.to with more than one value so it looks like&amp;nbsp;&lt;BR /&gt;&lt;A href="mailto:example@gmail.com,example2@gmail.com" target="_blank"&gt;example@gmail.com,example2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and in such cases there is no mailing mapping so the teamName fields comes up empty&lt;/P&gt;&lt;P&gt;Is there a way to split the values in this column to separate values so it will find the correct key in the lookup ?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 12:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613759#M213309</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2022-09-20T12:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613864#M213329</link>
      <description>&lt;P&gt;In the join subsearch, 'expand' the events like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| join savedsearch_name [
  | rest splunk_server=local count=0 /services/saved/searches 
  | rename title as savedsearch_name 
  | mvexpand "action.email.to"
  | lookup mailingList.csv "action.email.to" OUTPUT teamName
  | table action.email.to savedsearch_name teamName]&lt;/LI-CODE&gt;&lt;P&gt;the mvexpand will split out the multi-value field and create a new event with all the other fields intact for each value of the multi-value field.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 23:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613864#M213329</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-20T23:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613890#M213336</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thanks for your reply but looks like it haven't change anything &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;the results are still not splitted&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 07:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/613890#M213336</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2022-09-21T07:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614020#M213375</link>
      <description>&lt;P&gt;Can you give an example of what is returned for the subsearch query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest splunk_server=local count=0 /services/saved/searches 
| eval count=mvcount('action.email.to')
| table title "action.email.to" count&lt;/LI-CODE&gt;&lt;P&gt;please mask the email addresses&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 06:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614020#M213375</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-22T06:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614079#M213404</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;We are receiving title and under action.email.to some of the rows returns with one email and some of them&amp;nbsp; with more than one&lt;BR /&gt;when it is more than one then it returns in more than one pattern, for example:&lt;BR /&gt;&lt;A href="mailto:example@gmail.com,example1@gmail.com" target="_blank"&gt;example@gmail.com,example1@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:example@gmail.com" target="_blank"&gt;example@gmail.com&lt;/A&gt;&amp;nbsp; ,example1@gmail.com,&amp;nbsp; &lt;A href="mailto:example2@gmail.com" target="_blank"&gt;example2@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;also I see that the join return duplication so i have the same result more than once&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 10:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614079#M213404</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2022-09-22T10:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: compare query result with lookup result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614185#M213434</link>
      <description>&lt;P&gt;You need to split before mvexpand. &amp;nbsp;Then, as you have varying text patterns, you also need to clean up action.email.to before split. &amp;nbsp;Rex is an easier choice to combine the two.&lt;/P&gt;&lt;P&gt;Use the same formula&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;gave:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| join savedsearch_name [
  | rest splunk_server=local count=0 /services/saved/searches 
  | rename title as savedsearch_name, action.email.to as emailto
  | rex field=emailto max_match=0 "\b(?&amp;lt;emailto&amp;gt;[^\s,]+)"
  | mvexpand emailto
  | rename emailto as action.email.to
  | lookup mailingList.csv "action.email.to" OUTPUT teamName
  | table action.email.to savedsearch_name teamName]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Sep 2022 17:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-query-result-with-lookup-result/m-p/614185#M213434</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-22T17:21:41Z</dc:date>
    </item>
  </channel>
</rss>

