<?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 combine multiple complex searches into 1 output table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457264#M129187</link>
    <description>&lt;P&gt;You can use append command to combine both results, like this (also, remove few joins on lookup tables, use lookup command instead)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index ="12345" sourcetype = "system_database"
     | fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp 
    | dedup ipAddress, deviceName
     | lookup  manual_db.csv  deviceName 
     | lookup  manual_software_db.csv productFamily 
     | search swType = "105"
     | join deviceId [ search index="6789" sourcetype=output_command_here| spath status | search status=Enabled ]
     | table deviceName, productFamily, ipAddress, Tower, swVersion, reco_swVersion, swType
| append [search index ="12345" sourcetype = "system_database"
 | fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp   
| dedup ipAddress, deviceName 
 | lookup manual_db.csv deviceName 
 | lookup manual_software_db.csv productFamily 
 | lookup manual_vulnerability_list.csv productFamily 
 | where swVersion_Fixed &amp;gt; swVersion
 | table deviceName, productFamily, ipAddress, Advisory_ID, Tower, swVersion, reco_swVersion, swVersion_Fixed
 | sort productFamily
]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Jul 2018 15:52:09 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-07-25T15:52:09Z</dc:date>
    <item>
      <title>How to combine multiple complex searches into 1 output table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457263#M129186</link>
      <description>&lt;P&gt;I think I didn't describe my question properly because I don't really have a good grasp of Splunk Jargons but here are more details.&lt;/P&gt;

&lt;P&gt;this is search # 1: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index ="12345" sourcetype = "system_database"
| fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp   
| join deviceName [ | inputlookup manual_db.csv ]
| join productFamily [ | inputlookup manual_software_db.csv ]
| join productFamily [ | inputlookup manual_vulnerability_list.csv ]
| table deviceName, productFamily, ipAddress, Advisory_ID, Tower, swVersion, reco_swVersion, swVersion_Fixed
| dedup ipAddress, deviceName
| sort productFamily
| where swVersion_Fixed &amp;gt; swVersion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This produces a table with 8 columns and 20 lines.&lt;/P&gt;

&lt;P&gt;This is search #2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index ="12345" sourcetype = "system_database"
    | fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp 
    | join deviceName [ | inputlookup manual_db.csv ]
    | join productFamily [ | inputlookup manual_software_db.csv ]
    | search swType = "105"
    | join deviceId [ search index="6789" sourcetype=output_command_here| spath status | search status=Enabled ]
    | table deviceName, productFamily, ipAddress, Tower, swVersion, reco_swVersion, swType
    | dedup ipAddress, deviceName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This produces a table with 8 columns and 32 lines.&lt;/P&gt;

&lt;P&gt;The column size and headers are identical on both searches. I am trying to combine the results into 1 output. I tried multisearch but that won't work due to the use of 'join'. Please help!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457263#M129186</guid>
      <dc:creator>jonglim</dc:creator>
      <dc:date>2018-07-25T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple complex searches into 1 output table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457264#M129187</link>
      <description>&lt;P&gt;You can use append command to combine both results, like this (also, remove few joins on lookup tables, use lookup command instead)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index ="12345" sourcetype = "system_database"
     | fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp 
    | dedup ipAddress, deviceName
     | lookup  manual_db.csv  deviceName 
     | lookup  manual_software_db.csv productFamily 
     | search swType = "105"
     | join deviceId [ search index="6789" sourcetype=output_command_here| spath status | search status=Enabled ]
     | table deviceName, productFamily, ipAddress, Tower, swVersion, reco_swVersion, swType
| append [search index ="12345" sourcetype = "system_database"
 | fields deviceId, deviceName, ipAddress, swType, productFamily, swVersion, timeStamp   
| dedup ipAddress, deviceName 
 | lookup manual_db.csv deviceName 
 | lookup manual_software_db.csv productFamily 
 | lookup manual_vulnerability_list.csv productFamily 
 | where swVersion_Fixed &amp;gt; swVersion
 | table deviceName, productFamily, ipAddress, Advisory_ID, Tower, swVersion, reco_swVersion, swVersion_Fixed
 | sort productFamily
]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jul 2018 15:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457264#M129187</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-25T15:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple complex searches into 1 output table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457265#M129188</link>
      <description>&lt;P&gt;append works! thanks!&lt;/P&gt;

&lt;P&gt;the lookup had som problem sso i kinda reverted to join.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 17:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457265#M129188</guid>
      <dc:creator>jonglim</dc:creator>
      <dc:date>2018-07-25T17:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple complex searches into 1 output table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457266#M129189</link>
      <description>&lt;P&gt;instead of join, it may be more efficient to use lookup command.  E.g.&lt;/P&gt;

&lt;P&gt;index ="12345" sourcetype = "system_database" | lookup manual_db.csv deviceName | lookup manual_software_db.csv productFamily | lookup manual_software_db.csv | search swType=105 ...&lt;/P&gt;

&lt;P&gt;Every subsearch is a search which needs to complete before Splunk can proceed to the next step so it is always a good idea to reduce the number of joins/subsearches wherever possible.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-multiple-complex-searches-into-1-output-table/m-p/457266#M129189</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2020-09-29T20:38:56Z</dc:date>
    </item>
  </channel>
</rss>

