<?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: Merging events from two indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553864#M157246</link>
    <description>&lt;P&gt;the field bytes already existed in paloalto logs, so with your query it might get overwrote .&lt;/P&gt;&lt;P&gt;below my draft query so far, using few variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=sns 
| eval src_ip=if(index="sns",src,src_ip), dest_ip=if(index="sns",dst,dest_ip), bytes_new=if(index="sns",bytes_in+bytes_out, bytes)
| search src_ip="$source_ip$" AND dest_ip="$destination_ip$" AND action="$fw_action$"
| table _time, index, host, action, src_ip, dest_ip, app, user, src_port, dest_port, bytes_new, vendor_action&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 15:25:22 GMT</pubDate>
    <dc:creator>corti77</dc:creator>
    <dc:date>2021-06-01T15:25:22Z</dc:date>
    <item>
      <title>Merging events from two indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553839#M157236</link>
      <description>&lt;P&gt;I would like to create a dashboard to query the logs of our two firewall devices (paloalto and sns). Both has their own index created.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly I tried to simply query both indexes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=sns
| table _time, action, src_ip, dest_ip, app, user, src_port, dest_port, bytes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the issue that in the stormshield index some fields are named slightly different. I then tried to rename the values in order to merge all events from both indexes... but I didnt succeed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs
[ search
index=sns
| rename src as src_ip, dst as dest_ip
| eval bytes=bytes_in+bytes_out ]
| table _time, action, src_ip, dest_ip, app, user, src_port, dest_port, bytes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could someone point me to the right direction?&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 12:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553839#M157236</guid>
      <dc:creator>corti77</dc:creator>
      <dc:date>2021-06-01T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merging events from two indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553841#M157237</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234300"&gt;@corti77&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;your first approach is better: you have to use eval and rename to merge data, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=sns
| eval src_ip=if(index="sns",src,src_ip), dest_ip=if(index="sns",dst,dest_ip),  bytes=bytes_in+bytes_out 
| table _time action src_ip dest_ip app user src_port dest_port bytes&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 12:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553841#M157237</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-01T12:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Merging events from two indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553843#M157238</link>
      <description>&lt;P&gt;The second search was very close.&amp;nbsp; Using a subsearch creates a very different type of query, however.&amp;nbsp; Just add the rename command - there' s no need to associated it with a specific index because it will only apply to events with the stated fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=sns
| rename src as src_ip, dst as dest_ip
| eval bytes=bytes_in+bytes_out
| table _time, action, src_ip, dest_ip, app, user, src_port, dest_port, bytes&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Jun 2021 12:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553843#M157238</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-06-01T12:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merging events from two indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553864#M157246</link>
      <description>&lt;P&gt;the field bytes already existed in paloalto logs, so with your query it might get overwrote .&lt;/P&gt;&lt;P&gt;below my draft query so far, using few variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=pan_logs OR index=sns 
| eval src_ip=if(index="sns",src,src_ip), dest_ip=if(index="sns",dst,dest_ip), bytes_new=if(index="sns",bytes_in+bytes_out, bytes)
| search src_ip="$source_ip$" AND dest_ip="$destination_ip$" AND action="$fw_action$"
| table _time, index, host, action, src_ip, dest_ip, app, user, src_port, dest_port, bytes_new, vendor_action&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 15:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merging-events-from-two-indexes/m-p/553864#M157246</guid>
      <dc:creator>corti77</dc:creator>
      <dc:date>2021-06-01T15:25:22Z</dc:date>
    </item>
  </channel>
</rss>

