<?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: Splunk Use Case in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610201#M212192</link>
    <description>&lt;P&gt;When I run this:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| stats values(USER) as USER by IP transactionID
| where mvcount(USER) &amp;gt; 1&lt;/PRE&gt;&lt;P&gt;It brings something like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;IP&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;transactionID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;USER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;some ID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The issue is that it is picking JOSEPH's IP address only and not JACINTA's and both users are using different IP's when I check individually for each user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)
    | eval "IP OF &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" = IP]
| stats values(USER) as USER values(USERID_X) as USERID_X values(eval('IP OF USERID_X')) as "IP OF USERID_X" values(USERID_Y) as USERID_Y values(eval('IP OF USERID_Y')) as "IP OF USERID_Y" values(USERID_Z) as USERID_Z values(eval('IP OF USERID_Z')) as "IP OF USERID_Z" by transactionID&lt;/PRE&gt;&lt;P&gt;I get something close to this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USER&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;JANE&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;JANE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;BEATRICE&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BEATRICE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;AMY&lt;/P&gt;&lt;P&gt;DIANA&lt;/P&gt;&lt;P&gt;BELLA&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;AMY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;DIANA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.2&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BELLA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="114px"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The issue here is that when I use &lt;EM&gt;&lt;STRONG&gt;BY Transaction_ID&lt;/STRONG&gt;&lt;/EM&gt;, the IP addresses disappear and I am only left with the fields &lt;EM&gt;USER, USERID_X, USERID_Y and USERID_Z.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Removing the line &lt;EM&gt;&lt;STRONG&gt;BY TRANSACTION_ID&lt;/STRONG&gt;&lt;/EM&gt; populates the whole table but the issue is that IP addresses duplicate across the fields for&amp;nbsp;&lt;EM&gt;USER, USERID_X, USERID_Y and USERID_Z&lt;/EM&gt;&amp;nbsp;and are not correctly mapped to the correct user.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I see something like:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;USER&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;Martha&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Jane&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Jane&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Martha&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;And I know that the IP addresses assigned to Martha and Jane are in-correct&amp;nbsp; because I have run searches for each individual user to see their individual IP addresses.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Aug 2022 08:47:19 GMT</pubDate>
    <dc:creator>Splunk_Master01</dc:creator>
    <dc:date>2022-08-20T08:47:19Z</dc:date>
    <item>
      <title>Splunk Use Case- How can I compare two IP addresses when IP address is only available in one sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609584#M211958</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I am trying to build a use case with the below scenarios:&lt;/P&gt;
&lt;P&gt;1) Person A can do tasks X and Y but not task Z or,&lt;/P&gt;
&lt;P&gt;2) Person A can do tasks Y and Z but not task X or,&lt;/P&gt;
&lt;P&gt;3) Person A can either do task X or task Y or task Z&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;At no given point is Person A allowed to conduct all three tasks and at no given point should the IP addresses of Person A and Person B be the same.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Information is being picked from two separate source types from the same index.&lt;/P&gt;
&lt;P&gt;The challenge is picking the IP address when Person A does tasks X and Y and Person B does task Z, how can I get the IP addresses of both Person A and Person B, so as to compare and make sure that they are two different IP addresses, keeping in mind that the IP address is only available in one source type and not the other?&lt;/P&gt;
&lt;P&gt;Any assistance on this would be appreciated ...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 13:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609584#M211958</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-16T13:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609598#M211963</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248153"&gt;@Splunk_Master01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;maybe there's an error in the question: you sayed:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3) Person A can either do task X or task Y or task Z&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;At no given point is Person A allowed to conduct all three tasks&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;then you don't give any condition for PersonB.&lt;/P&gt;&lt;P&gt;Then some additional information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I suppose that IP address is in a field called "ip_address"&lt;/LI&gt;&lt;LI&gt;you have ip_address of PersonA and PersonB from the first sourcetype, instead tasks are from the second sourcetype, is this correct?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 07:58:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609598#M211963</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-16T07:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609609#M211968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes. IP address of Person A and Person B are in one source type and the tasks being performed by Person A and Person B are in the other source type and both&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;source types belong to the same index.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 08:22:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609609#M211968</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-16T08:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609659#M211989</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248153"&gt;@Splunk_Master01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can correlate data from different sourcetypes using the stats command, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (sourcetype=sourcetypeA OR sourcetype=sourcetypeB)
| stats dc(ip_address) AS ip_count values(ip_address) AS ip_address values(task) AS task BY person&lt;/LI-CODE&gt;&lt;P&gt;Having all these correlated information, you can find the rules you like: e.g. if there's more than ip, etc...&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609659#M211989</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-16T14:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609753#M212027</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried this, but it still doesn't bring the IP addresses of both Person A and Person B.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The query picks the IP address of only Person A.&lt;/P&gt;&lt;P&gt;I need both IP addresses to be displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 05:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609753#M212027</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-17T05:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609768#M212033</link>
      <description>&lt;P&gt;gcusello's code &lt;EM&gt;should&lt;/EM&gt;&amp;nbsp;result in a list like the following&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;person&lt;/TD&gt;&lt;TD width="25%"&gt;ip_count&lt;/TD&gt;&lt;TD width="25%"&gt;ip_address&lt;/TD&gt;&lt;TD width="25%"&gt;task&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Person A&lt;/TD&gt;&lt;TD width="25%"&gt;2&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;10.101.8.1&lt;/P&gt;&lt;P&gt;10.101.9.3&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;X&lt;/P&gt;&lt;P&gt;Y&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Person B&lt;/TD&gt;&lt;TD width="25%"&gt;3&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;10.101.7.105&lt;/P&gt;&lt;P&gt;10.101.8.1&lt;/P&gt;&lt;P&gt;10.101.8.12&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;Z&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If in your data you only see one line, check your search time period to make sure both Person A and Person B have activities.&lt;/P&gt;&lt;P&gt;The code does not directly address the part of requirement about &lt;STRONG&gt;&lt;EM&gt;At no given point&lt;/EM&gt;&lt;/STRONG&gt;. &amp;nbsp;You may need a time bucket variable to flesh that out. &amp;nbsp;In physics, there is no such a thing as a point in time, so I assume that you meant "during no given time interval" (of a predefined length). &amp;nbsp;In general you don't want to deal with a rolling time interval in Splunk, so choose a meaningful span, say, 1h, and use gcusello's formula with this modifier&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (sourcetype=sourcetypeA OR sourcetype=sourcetypeB)
| bin span=1h _time
| stats dc(ip_address) AS ip_count values(ip_address) AS ip_address values(task) AS task BY _time person&lt;/LI-CODE&gt;&lt;P&gt;The span can be any value that is a common multiple of your data collection intervals.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 07:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609768#M212033</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-17T07:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609919#M212093</link>
      <description>&lt;P&gt;I am using the below query:&lt;/P&gt;&lt;P&gt;index=myindex (sourcetype="mysourcetype" OR sourcetype=mysouretype)&lt;BR /&gt;|&amp;nbsp; eval USER = mvappend(USERID_A,USERID_X,USERID_Y,USERID_Z)&lt;BR /&gt;|&amp;nbsp; stats dc(IP) as IP_COUNT values(IP) as IP values(USERID_X) values(USERID_Y) values(USERID_Z) BY USER&lt;/P&gt;&lt;P&gt;The reason behind usage of mvappend is because the usernames in both source types have different titles.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The results I get with the above query are depicted in the table below:&lt;/P&gt;&lt;TABLE border="1" width="64.14643392810557%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="8.914728682170544%"&gt;&lt;EM&gt;&lt;STRONG&gt;USER&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="10.59431524547804%"&gt;&lt;EM&gt;&lt;STRONG&gt;IP_COUNT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="4.780361757105945%"&gt;&lt;EM&gt;&lt;STRONG&gt;IP&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="13.63049095607236%"&gt;&lt;EM&gt;&lt;STRONG&gt;USERID_X&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="13.242894056847538%"&gt;&lt;EM&gt;&lt;STRONG&gt;USERID_Y&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="12.984496124031011%"&gt;&lt;EM&gt;&lt;STRONG&gt;USERID_Z&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="8.914728682170544%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.59431524547804%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="4.780361757105945%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="13.63049095607236%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="13.242894056847538%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.984496124031011%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The IP that is currently being picked is for &lt;EM&gt;&lt;STRONG&gt;"USER"&lt;/STRONG&gt;&lt;/EM&gt; and &lt;EM&gt;&lt;STRONG&gt;"USERID_X"&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; but I require IP addresses of&amp;nbsp; USERID_Y and USERID_Z as well, as in some situations they vary. After that I need to put in the IF statement to compare IP addresses to make sure that they are not the same.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 07:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609919#M212093</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-18T07:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609932#M212097</link>
      <description>&lt;P&gt;First, how does USERID_A factor into the equation in your illustration? (I interpret "title" as field name.)&lt;/P&gt;&lt;P&gt;Second, how did you determine that only USERID_X is being picked up? &amp;nbsp;More fundamentally, how did you determine that events containing USERID_Y and USERID_Z are actually in your search range?&lt;/P&gt;&lt;P&gt;Let's examine data. &amp;nbsp;Perform this simple test for each of USERID_X, USERID_Y, USERID_Z&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB) USERID_X=*
|  eval USER = mvappend(USERID_A,USERID_X,USERID_Y,USERID_Z)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Are there any events with USERID_Y and USERID_Z? What are values of USER in each case?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 08:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609932#M212097</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-18T08:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609945#M212100</link>
      <description>&lt;P&gt;I have run the below test query changing the USERID to X, Y and Z respectively:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB) USERID_X=*
|  eval USER = mvappend(USERID_A,USERID_X,USERID_Y,USERID_Z)&lt;/PRE&gt;&lt;P&gt;Each time the USERID changes to X,Y or Z, results are populated for USER, USERID_X, USERID_Y and USERID_Z.&lt;/P&gt;&lt;P&gt;What I've noticed is that either values in USER, USERID_X and USERID_Y are the same or values in USER, USERID_Y and USERID_Z are the same.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 09:22:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609945#M212100</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-18T09:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609947#M212101</link>
      <description>&lt;P&gt;Maybe I should have designed the test a little more comprehensively, as your main interest is to examine IP. &amp;nbsp;How about&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB) USERID_X=*
| eval USER = mvappend(USERID_A,USERID_X,USERID_Y,USERID_Z)
| eventstats values(IP) as IPs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Replace USERID_X with other field names. &amp;nbsp;Do the resultant IPs field vary? &amp;nbsp;How do values of IPs overlap?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 09:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609947#M212101</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-18T09:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609961#M212104</link>
      <description>&lt;P&gt;I have run the below query as advised.&lt;/P&gt;&lt;P&gt;I get no results when I change the values to X,Y and Z respectively.&lt;/P&gt;&lt;P&gt;However removing the line USERID_X=* generates results of IP addresses.&lt;/P&gt;&lt;P&gt;The users are different in every row, but the IP addresses being picked are for all IP's in a subnet and all subnets and not the specific users that are part of the row.&lt;/P&gt;&lt;P&gt;Results are something as below:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%"&gt;USER&lt;/TD&gt;&lt;TD width="20%"&gt;USERID_X&lt;/TD&gt;&lt;TD width="20%"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="20%"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="20%"&gt;IPs&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%"&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;/TD&gt;&lt;TD width="20%"&gt;Mary&lt;/TD&gt;&lt;TD width="20%"&gt;Mary&lt;/TD&gt;&lt;TD width="20%"&gt;Jane&lt;/TD&gt;&lt;TD width="20%"&gt;&lt;P&gt;10.10.1.1&lt;/P&gt;&lt;P&gt;10.10.1.2&lt;/P&gt;&lt;P&gt;10.10.1.3&lt;/P&gt;&lt;P&gt;10.10.2.1&lt;/P&gt;&lt;P&gt;10.10.2.2&lt;/P&gt;&lt;P&gt;10.10.2.3&lt;/P&gt;&lt;P&gt;10.10.3.1&lt;/P&gt;&lt;P&gt;10.10.3.2&lt;/P&gt;&lt;P&gt;10.10.3.3&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I find out which IP belongs to Mary and which IP belongs to Jane from the long list of IPs?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 10:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/609961#M212104</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-18T10:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610045#M212132</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248153"&gt;@Splunk_Master01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have run the below query as advised.&lt;/P&gt;&lt;P&gt;I get no results when I change the values to X,Y and Z respectively.&lt;/P&gt;&lt;P&gt;However removing the line USERID_X=* generates results of IP addresses.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This means that USERID_X, USERID_Y, etc., are not searchable fields in raw search. &amp;nbsp;This is just to get an understanding of the data and unrelated to the solution.&lt;/P&gt;&lt;P&gt;To perform stats on disparate field names, you may iterate over them with&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt;. &amp;nbsp;For example,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| stats dc(IP) as IP_COUNT values(IP) as IP BY USER&lt;/LI-CODE&gt;&lt;P&gt;(This assumes that different field names do not appear in the same event.) &amp;nbsp;If these field names have a common pattern, you may use wildcard to enumerate, like &lt;FONT face="andale mono,times"&gt;foreach USERID_*&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 22:13:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610045#M212132</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-18T22:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610074#M212143</link>
      <description>&lt;P&gt;I require something like the below:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USER&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;JANE&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;JANE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;BEATRICE&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BEATRICE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;AMY&lt;/P&gt;&lt;P&gt;DIANA&lt;/P&gt;&lt;P&gt;BELLA&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;AMY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;DIANA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.2&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BELLA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="114px"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the row highlighted in &lt;STRONG&gt;bold&lt;/STRONG&gt; needs to be fired as an alert as all the IP's are the same.&lt;/P&gt;&lt;P&gt;How can I achieve something like the table above?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 05:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610074#M212143</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-19T05:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610190#M212183</link>
      <description>&lt;P&gt;You need to better describe data to explain how they relate to your mockup. What is the mechanism/criteria to group&amp;nbsp;MARY,&amp;nbsp;MARY,&amp;nbsp;JANE in one row and&amp;nbsp;BEATRICE,&amp;nbsp;ARTHUR,&amp;nbsp;ARTHUR in another row? &amp;nbsp;Is it some sort of session, transaction/sequence? &amp;nbsp;Time bucket?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 04:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610190#M212183</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-20T04:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610191#M212184</link>
      <description>&lt;P&gt;Transactions being conducted by them.&lt;/P&gt;&lt;P&gt;The problem is some data is one sourcetype and IP address is in another sourcetype.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So picking IP addresses of the people is a challenge.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 04:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610191#M212184</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-20T04:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610194#M212187</link>
      <description>&lt;P&gt;Still unclear. &amp;nbsp;Do you mean each row is associated with a unique transaction ID?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 05:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610194#M212187</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-20T05:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610196#M212188</link>
      <description>&lt;P&gt;Yes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 05:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610196#M212188</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-20T05:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610198#M212190</link>
      <description>&lt;P&gt;Let's first take the alert action you described in the mockup. &amp;nbsp;This should be sufficient for that purpose, is it not?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| stats values(USER) as USER by IP transactionID
| where mvcount(USER) &amp;gt; 1&lt;/LI-CODE&gt;&lt;P&gt;Judging from your mockup, the above should give something like&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;IP&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;transactionID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;USER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;some ID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;What is the use of knowing "IP of USERID_X", "IP of USERID_Y"? (Especially when, as illustrated, MARY has the exact same IP address in the same transaction whether she appears as USERID_X or USERID_Y, so does AUTHUR in the same transaction whether he appears as USERID_Y or USERID_Z.) &amp;nbsp;This table tells you exactly which transaction encountered one or more IP addresses that are each used by more than one user. &amp;nbsp;The alert shouldn't care about what is the original field name that is merged into USER, or which transactions are without such incidents.&lt;/P&gt;&lt;P&gt;This said, suppose the redundant listing has meaning to someone - I also have bosses that are particular about layout, you can spaghettify code to give&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)
    | eval "IP OF &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" = IP]
| stats values(USER) as USER values(USERID_X) as USERID_X values(eval('IP OF USERID_X')) as "IP OF USERID_X" values(USERID_Y) as USERID_Y values(eval('IP OF USERID_Y')) as "IP OF USERID_Y" values(USERID_Z) as USERID_Z values(eval('IP OF USERID_Z')) as "IP OF USERID_Z" by transactionID&lt;/LI-CODE&gt;&lt;P&gt;This should produce the same layout as your mockup except the added column of transactionID without which the problem is ill-defined. &amp;nbsp;Again, using wildcard and such could reduce the amount of typing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 07:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610198#M212190</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-20T07:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610201#M212192</link>
      <description>&lt;P&gt;When I run this:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| stats values(USER) as USER by IP transactionID
| where mvcount(USER) &amp;gt; 1&lt;/PRE&gt;&lt;P&gt;It brings something like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;IP&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;transactionID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;USER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;some ID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The issue is that it is picking JOSEPH's IP address only and not JACINTA's and both users are using different IP's when I check individually for each user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)
    | eval "IP OF &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" = IP]
| stats values(USER) as USER values(USERID_X) as USERID_X values(eval('IP OF USERID_X')) as "IP OF USERID_X" values(USERID_Y) as USERID_Y values(eval('IP OF USERID_Y')) as "IP OF USERID_Y" values(USERID_Z) as USERID_Z values(eval('IP OF USERID_Z')) as "IP OF USERID_Z" by transactionID&lt;/PRE&gt;&lt;P&gt;I get something close to this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USER&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="47px"&gt;IP OF USERID_Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;MARY&lt;/P&gt;&lt;P&gt;JANE&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;MARY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;JANE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;BEATRICE&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;P&gt;ARTHUR&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BEATRICE&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;ARTHUR&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.2.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;&lt;P&gt;AMY&lt;/P&gt;&lt;P&gt;DIANA&lt;/P&gt;&lt;P&gt;BELLA&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;AMY&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.1&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;DIANA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.2&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;BELLA&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="114px"&gt;10.10.3.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="114px"&gt;&lt;P&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JOSEPH&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;JACINTA&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD height="114px"&gt;&lt;STRONG&gt;10.10.4.1&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The issue here is that when I use &lt;EM&gt;&lt;STRONG&gt;BY Transaction_ID&lt;/STRONG&gt;&lt;/EM&gt;, the IP addresses disappear and I am only left with the fields &lt;EM&gt;USER, USERID_X, USERID_Y and USERID_Z.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Removing the line &lt;EM&gt;&lt;STRONG&gt;BY TRANSACTION_ID&lt;/STRONG&gt;&lt;/EM&gt; populates the whole table but the issue is that IP addresses duplicate across the fields for&amp;nbsp;&lt;EM&gt;USER, USERID_X, USERID_Y and USERID_Z&lt;/EM&gt;&amp;nbsp;and are not correctly mapped to the correct user.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I see something like:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;USER&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_X&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_Y&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;USERID_Z&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;IP OF USERID_Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;Martha&lt;/P&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Jane&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Jane&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Martha&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;10.10.1.1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;And I know that the IP addresses assigned to Martha and Jane are in-correct&amp;nbsp; because I have run searches for each individual user to see their individual IP addresses.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 08:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610201#M212192</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-20T08:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Use Case</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610202#M212193</link>
      <description>&lt;P&gt;I need results to be close to this format:&lt;/P&gt;&lt;PRE&gt;index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
|  foreach USERID_X USERID_Y USERID_Z
    [eval USER = if(isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;), USER, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)
    | eval "IP OF &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" = IP]
| stats values(USER) as USER values(USERID_X) as USERID_X values(eval('IP OF USERID_X')) as "IP OF USERID_X" values(USERID_Y) as USERID_Y values(eval('IP OF USERID_Y')) as "IP OF USERID_Y" values(USERID_Z) as USERID_Z values(eval('IP OF USERID_Z')) as "IP OF USERID_Z" by transactionID&lt;/PRE&gt;&lt;P&gt;But I need information be picked correctly for each user.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 09:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Use-Case-How-can-I-compare-two-IP-addresses-when-IP/m-p/610202#M212193</guid>
      <dc:creator>Splunk_Master01</dc:creator>
      <dc:date>2022-08-20T09:36:39Z</dc:date>
    </item>
  </channel>
</rss>

