<?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 multivalues from different rows in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649254#M224508</link>
    <description>&lt;P&gt;Work as intended, great thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2023 07:11:27 GMT</pubDate>
    <dc:creator>farhad</dc:creator>
    <dc:date>2023-07-05T07:11:27Z</dc:date>
    <item>
      <title>Compare multivalues from different rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649123#M224479</link>
      <description>&lt;P&gt;In my search i have 2 rows, column specifying the week and the other column a multi-value field of EventIDs. I need to compare one row multievalue field to another row multi value field. And Output the different event values from these 2 rows.&lt;/P&gt;&lt;P&gt;______________________________&lt;BR /&gt;&lt;BR /&gt;my search&lt;BR /&gt;| stats values(EventID) by week&lt;BR /&gt;&lt;BR /&gt;Result:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;week&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;values(EventID)&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="465px"&gt;This week&lt;/TD&gt;&lt;TD width="50%" height="465px"&gt;&lt;DIV class=""&gt;4624&lt;/DIV&gt;&lt;DIV class=""&gt;4625&lt;/DIV&gt;&lt;DIV class=""&gt;4627&lt;/DIV&gt;&lt;DIV class=""&gt;4634&lt;/DIV&gt;&lt;DIV class=""&gt;4647&lt;/DIV&gt;&lt;DIV class=""&gt;4648&lt;/DIV&gt;&lt;DIV class=""&gt;4656&lt;/DIV&gt;&lt;DIV class=""&gt;4658&lt;/DIV&gt;&lt;DIV class=""&gt;4661&lt;/DIV&gt;&lt;DIV class=""&gt;4663&lt;/DIV&gt;&lt;DIV class=""&gt;4664&lt;/DIV&gt;&lt;DIV class=""&gt;4670&lt;/DIV&gt;&lt;DIV class=""&gt;4672&lt;/DIV&gt;&lt;DIV class=""&gt;4673&lt;/DIV&gt;&lt;DIV class=""&gt;4674&lt;/DIV&gt;&lt;DIV class=""&gt;4688&lt;/DIV&gt;&lt;DIV class=""&gt;4689&lt;/DIV&gt;&lt;DIV class=""&gt;4690&lt;/DIV&gt;&lt;DIV class=""&gt;4692&lt;/DIV&gt;&lt;DIV class=""&gt;4693&lt;/DIV&gt;&lt;DIV class=""&gt;4698&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;Previous Week&lt;/TD&gt;&lt;TD height="25px"&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;4624&lt;/DIV&gt;&lt;DIV class=""&gt;4625&lt;/DIV&gt;&lt;DIV class=""&gt;4627&lt;/DIV&gt;&lt;DIV class=""&gt;4634&lt;/DIV&gt;&lt;DIV class=""&gt;4647&lt;/DIV&gt;&lt;DIV class=""&gt;4648&lt;/DIV&gt;&lt;DIV class=""&gt;4656&lt;/DIV&gt;&lt;DIV class=""&gt;4658&lt;/DIV&gt;&lt;DIV class=""&gt;4661&lt;/DIV&gt;&lt;DIV class=""&gt;4663&lt;/DIV&gt;&lt;DIV class=""&gt;4664&lt;/DIV&gt;&lt;DIV class=""&gt;4670&lt;/DIV&gt;&lt;DIV class=""&gt;4672&lt;/DIV&gt;&lt;DIV class=""&gt;4673&lt;/DIV&gt;&lt;DIV class=""&gt;4674&lt;/DIV&gt;&lt;DIV class=""&gt;4688&lt;/DIV&gt;&lt;DIV class=""&gt;4689&lt;/DIV&gt;&lt;DIV class=""&gt;4690&lt;/DIV&gt;&lt;DIV class=""&gt;4692&lt;/DIV&gt;&lt;DIV class=""&gt;4693&lt;/DIV&gt;&lt;DIV class=""&gt;4698&lt;/DIV&gt;&lt;DIV class=""&gt;4702&lt;/DIV&gt;&lt;DIV class=""&gt;4720&lt;/DIV&gt;&lt;DIV class=""&gt;4722&lt;/DIV&gt;&lt;DIV class=""&gt;4724&lt;/DIV&gt;&lt;DIV class=""&gt;4725&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i desire to compare "this week" event values with "previous week" event values and table values not seen in both weeks. Any suggestions is much appreciated, thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 13:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649123#M224479</guid>
      <dc:creator>farhad</dc:creator>
      <dc:date>2023-07-04T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Compare multivalues from different rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649163#M224489</link>
      <description>&lt;P&gt;You have to use transpose to get the values into the same event so you can compare them; can then transpose again to return them to different event (if that's what you require).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| transpose 0 header_field=week column_name=events
| foreach mode=multivalue "Previous Week"
    [| eval missing=if(in(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;,'This week'),missing,mvappend(missing,&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;))]
| foreach mode=multivalue "This week"
    [| eval new=if(in(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;,'Previous Week'),new,mvappend(new,&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;))]
| transpose 0 header_field=events column_name=week&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Jul 2023 15:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649163#M224489</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-04T15:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compare multivalues from different rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649165#M224490</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251818"&gt;@farhad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| stats values(week) as weeks by EventID 
| eval status = case(mvcount(weeks)==2,"Available In Both",weeks="This week","Available In This Week",weeks="Previous Week","Available In Previous Week") 
| stats values(EventID) as EventIDs by status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="week	EventID
This week	4624,4625,4627,4634,4647,4648,4656,4658,4661,4663,4664,4670,4672,4673,4674,4688,4689,4690,4692,4693,4698,100,102,103
Previous Week	4624,4625,4627,4634,4647,4648,4656,4658,4661,4663,4664,4670,4672,4673,4674,4688,4689,4690,4692,4693,4698,4702,4720,4722,4724,4725
" 
| multikv forceheader=1 
| eval EventID=split(EventID,",") 
| mvexpand EventID 
| table week EventID 
| rename comment as "Upto now is for sample data only"
| stats values(week) as weeks by EventID 
| eval status = case(mvcount(weeks)==2,"Available In Both",weeks="This week","Available In This Week",weeks="Previous Week","Available In Previous Week") 
| stats values(EventID) as EventIDs by status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-07-04 at 8.58.03 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26120i3531DEFAEBE7993E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-07-04 at 8.58.03 PM.png" alt="Screenshot 2023-07-04 at 8.58.03 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 15:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649165#M224490</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-07-04T15:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare multivalues from different rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649254#M224508</link>
      <description>&lt;P&gt;Work as intended, great thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 07:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-multivalues-from-different-rows/m-p/649254#M224508</guid>
      <dc:creator>farhad</dc:creator>
      <dc:date>2023-07-05T07:11:27Z</dc:date>
    </item>
  </channel>
</rss>

