<?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: Searching 2 indexes comparing 2 fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744490#M241256</link>
    <description>&lt;P&gt;This seems to be working great, over 24 hours I get a few quirks but I can live with it. Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2025 15:35:16 GMT</pubDate>
    <dc:creator>MrGlass</dc:creator>
    <dc:date>2025-04-18T15:35:16Z</dc:date>
    <item>
      <title>Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744433#M241243</link>
      <description>&lt;P&gt;I am trying to locate some data between two indexes, the common items are the src_interface and the network device name, but the data gets jumbled up when searching over longer periods of time. This is what I am using now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=network "arp-inspection" OR "packets received"&lt;BR /&gt;| rename mnemonic as Port_Status&lt;BR /&gt;| rename Network_Device TO "NetworkDeviceName"&lt;BR /&gt;| rename src_interface TO "src_int"&lt;BR /&gt;| join type=inner "NetworkDeviceName" , "src_int"&lt;BR /&gt;[ search index=cisco_ise sourcetype=cisco:ise:syslog User_Name="host/*"]&lt;BR /&gt;| table&amp;nbsp; device_time, NetworkDeviceName, User_Name, src_int, src_ip, src_mac, message_text, Location, Port_Status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 15:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744433#M241243</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-04-17T15:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744435#M241244</link>
      <description>&lt;P&gt;Try to avoid using join - I suspect "&lt;SPAN&gt;data gets jumbled up when searching over longer periods of time" (not very precise terminology) is because subsearches (as used by join) are silently truncated at 50,000 events, so you join may not have all the events available that you are expecting (when you have extended periods of time). Try something along these lines:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=network "arp-inspection" OR "packets received") OR (index=cisco_ise sourcetype=cisco:ise:syslog User_Name="host/*")
| rename mnemonic as Port_Status
| rename Network_Device as "NetworkDeviceName"
| rename src_interface as "src_int"
| stats values(device_time) as device_time, values(User_Name) as User_Name, values(src_ip) as src_ip, values(src_mac) as src_mac, values(message_text) as message_text, values(Location) as Location, values(Port_Status) as Port_Status by NetworkDeviceName, src_int&lt;/LI-CODE&gt;&lt;P&gt;or perhaps:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=network "arp-inspection" OR "packets received") OR (index=cisco_ise sourcetype=cisco:ise:syslog User_Name="host/*")
| eval Port_Status=coalesce(Port_Status, mnemonic)
| eval NetworkDeviceName=coalesce(NetworkDeviceName, Network_Device)
| eval src_int=coalesce(src_int, src_interface)
| stats values(device_time) as device_time, values(User_Name) as User_Name, values(src_ip) as src_ip, values(src_mac) as src_mac, values(message_text) as message_text, values(Location) as Location, values(Port_Status) as Port_Status by NetworkDeviceName, src_int&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 17 Apr 2025 15:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744435#M241244</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-04-17T15:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744437#M241245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266204"&gt;@MrGlass&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Splunk isn't a database, so the join command must be used only when there isn't any other solution and when you have few data, instead use stats, somerhing lie this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=network "arp-inspection" OR "packets received") OR (index=cisco_ise sourcetype=cisco:ise:syslog User_Name="host/*")
| eval NetworkDeviceName=coalece(NetworkDeviceName, Network_Device)
| rename 
     mnemonic AS Port_Status 
| rename src_interface AS "src_int"
| stats 
     earliest(device_time) AS device_time
     values(User_Name) AS User_Name
     values(src_ip) AS src_ip
     values(src_mac) AS src_mac
     values(message_text) AS message_text
     values(Location) AS Location
     values(Port_Status) AS Port_Status
     BY "NetworkDeviceName" , "src_int"
| table  device_time, NetworkDeviceName, User_Name, src_int, src_ip, src_mac, message_text, Location, Port_Status&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 15:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744437#M241245</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-17T15:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744445#M241246</link>
      <description>&lt;P&gt;This seems to work but does not return any of the fields from the Index=cisco_ise. these are the fields in reference to the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Index=network&lt;BR /&gt;src_interface&lt;BR /&gt;Network_Device&lt;BR /&gt;message_text&lt;/P&gt;&lt;P&gt;Index=cisco_ise&lt;BR /&gt;src_int&lt;BR /&gt;NetworkDeviceName&lt;BR /&gt;User_Name&lt;BR /&gt;Location&lt;BR /&gt;src_ip&lt;BR /&gt;src_mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 17:29:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744445#M241246</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-04-17T17:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744446#M241247</link>
      <description>&lt;P&gt;You must add all needed fields in stats command if you want those to be present after its execution. Use values(a) as a values(b) as b like there is already used.&lt;/P&gt;&lt;P&gt;Here is one old post which explains who you should replace different joins in SPL.&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/What-is-the-relation-between-the-Splunk-inner-left-join-and-the/m-p/391288/thread-id/113948" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/What-is-the-relation-between-the-Splunk-inner-left-join-and-the/m-p/391288/thread-id/113948&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 17:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744446#M241247</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2025-04-17T17:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744451#M241248</link>
      <description>&lt;P&gt;There's a small mistake in&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;'s formula. &amp;nbsp;src_interface and src_int should be coalesced (also a small spelling error), not renamed.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=network "arp-inspection" OR "packets received") OR (index=cisco_ise sourcetype=cisco:ise:syslog User_Name="host/*")
| eval NetworkDeviceName=coalesce(NetworkDeviceName, Network_Device),
  src_int = coalesce(src_int, src_interface)
| rename 
     mnemonic AS Port_Status 
| stats 
     earliest(device_time) AS device_time
     values(User_Name) AS User_Name
     values(src_ip) AS src_ip
     values(src_mac) AS src_mac
     values(message_text) AS message_text
     values(Location) AS Location
     values(Port_Status) AS Port_Status
     BY "NetworkDeviceName" , "src_int"
| table  device_time, NetworkDeviceName, User_Name, src_int, src_ip, src_mac, message_text, Location, Port_Status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 19:57:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744451#M241248</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-04-17T19:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744490#M241256</link>
      <description>&lt;P&gt;This seems to be working great, over 24 hours I get a few quirks but I can live with it. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 15:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744490#M241256</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-04-18T15:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Searching 2 indexes comparing 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744531#M241272</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266204"&gt;@MrGlass&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, 19 Apr 2025 20:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-2-indexes-comparing-2-fields/m-p/744531#M241272</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-04-19T20:08:52Z</dc:date>
    </item>
  </channel>
</rss>

