<?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 compare same fields from different events to find past occurrence in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685706#M233963</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267290"&gt;@Josh1890&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Apr 2024 10:20:31 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-04-27T10:20:31Z</dc:date>
    <item>
      <title>How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685427#M233866</link>
      <description>&lt;P&gt;Editing to make it better:&lt;BR /&gt;Let's say I have login events with 2 important fields: past_deviceid, new_deviceid&lt;BR /&gt;I want to check if the new_deviceid was assigned to a different user in the past, for that I need to compare the value of the field to the past_deviceid field of past events and I'm kinda stuck here&lt;/P&gt;&lt;P&gt;In login events where the user uses their usual device, there'll be only 1 field called&amp;nbsp;past_deviceid, we get the new_deviceid field only when there's a login with a new device&lt;/P&gt;&lt;P&gt;In the end I want to have a table that shows the new_deviceid by all the users that hold/held it where there's more than 1 user&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;events with only 1 device:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;User: Josh&lt;BR /&gt;old_Device: iPhone12348&lt;/P&gt;&lt;P&gt;---------------------------&lt;BR /&gt;User: John&lt;BR /&gt;old_Device: samsung165&lt;/P&gt;&lt;P&gt;----------------------------&lt;BR /&gt;case where there's a new device:&lt;/P&gt;&lt;P&gt;User: Jane&lt;BR /&gt;old_Device: iPhone17778&lt;BR /&gt;new_Device: samsung165&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have the following table, I guess the stats command fits here:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;DeviceID&lt;/TD&gt;&lt;TD width="50%"&gt;User&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;samsung165&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 25 Apr 2024 10:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685427#M233866</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-25T10:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685431#M233868</link>
      <description>&lt;P&gt;Please can you share some anonymised representative events demonstrating your issue?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 09:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685431#M233868</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-25T09:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685436#M233869</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267290"&gt;@Josh1890&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;said, some sample coud help to better understand your requirement.&lt;/P&gt;&lt;P&gt;Anyway, if I correctly understood, you want to know if the new_id was assigned in the past to some different users; in other words, if there are more users with assigned the same new_id, is this correct?&lt;/P&gt;&lt;P&gt;It isn't so cluear for me the reation between new_id and past_id.&lt;/P&gt;&lt;P&gt;Anyway, in this case, you could try to run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| stats 
    dc(user) AS user_count
    values(user) AS user
    BY new_id
| where user_count&amp;gt;1&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 09:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685436#M233869</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-04-25T09:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685437#M233870</link>
      <description>&lt;P&gt;Updated the post, please take a look&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 09:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685437#M233870</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-25T09:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685438#M233871</link>
      <description>&lt;P&gt;Updated the post&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 09:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685438#M233871</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-25T09:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685439#M233872</link>
      <description>&lt;P&gt;And to answer your question, I want to see if the value of new_deviceid exists in other users old_deviceid field, meaning it was assigned to them in the past&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 09:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685439#M233872</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-25T09:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685441#M233873</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267290"&gt;@Josh1890&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| stats 
    dc(User) AS user_count
    values(User) AS user
    BY DeviceID
| where user_count&amp;gt;1&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 10:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685441#M233873</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-04-25T10:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685445#M233874</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;SPAN&gt;Giuseppe, the solution doesn't work since it doesn't include users who have the value of new_device inside their old_device field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Check the example in the post&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 10:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685445#M233874</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-25T10:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685451#M233877</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval devices=mvappend(old_device,new_device)
| stats values(user) as users by devices&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Apr 2024 11:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685451#M233877</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-25T11:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685705#M233962</link>
      <description>&lt;P&gt;I think this works, thanks&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 10:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685705#M233962</guid>
      <dc:creator>Josh1890</dc:creator>
      <dc:date>2024-04-27T10:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same fields from different events to find past occurrence</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685706#M233963</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267290"&gt;@Josh1890&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2024 10:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-fields-from-different-events-to-find-past/m-p/685706#M233963</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-04-27T10:20:31Z</dc:date>
    </item>
  </channel>
</rss>

