<?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 can I run this query more efficiently without using so many join commands? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243862#M189046</link>
    <description>&lt;P&gt;Wow that's amazing!!!! So much quicker and I get all the info I needed.&lt;/P&gt;

&lt;P&gt;Thanks very much, our OpsTeam will salute you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 15:35:42 GMT</pubDate>
    <dc:creator>kltest</dc:creator>
    <dc:date>2016-08-24T15:35:42Z</dc:date>
    <item>
      <title>How can I run this query more efficiently without using so many join commands?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243859#M189043</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm running the following query to combine data from two different sources and to create a table for our AppAssure monitoring:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="AppAssure1" source="WinEventLog:AppAssureMonitoring" EventCode=350| fields ServerName AgentStatus Version LatestSnapshot IsPaused LatestSnapshotStatus  RepositoryName| dedup ServerName | rename RepositoryName AS LocalRepositoryName | 

join type=outer ServerName [search host="AppAssure2" source="WinEventLog:AppAssureMonitoring" EventCode=150 |fields ServerName ReplicatedStatus ReplicatedTimeStamp | dedup ServerName] | 

join type=outer ServerName [search host="AppAssure1" source="WinEventLog:AppAssureMonitoring" EventCode=250 |fields ServerName ExportedTimeStamp ExportedStatus | dedup ServerName| rename ExportedTimeStamp AS LocalExportedTimeStamp|rename ExportedStatus AS LocalExportedStatus ] | 

join type=outer ServerName [search host="AppAssure2" source="WinEventLog:AppAssureMonitoring" EventCode=250 |fields ServerName ExportedTimeStamp ExportedStatus | dedup ServerName | rename ExportedTimeStamp AS ReplicaExportedTimeStamp| rename ExportedStatus AS ReplicaExportedStatus] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm aware that it's horribly inefficient, but can't see a way to get the same result without using the join command as I also need to rename the fields as I go etc. I have to run this query on multiple tables on the same dashboard and as you can imagine it takes quite a while to load.&lt;/P&gt;

&lt;P&gt;Can anyone clever point me in the right direction of where to go from here?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 12:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243859#M189043</guid>
      <dc:creator>kltest</dc:creator>
      <dc:date>2016-08-24T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I run this query more efficiently without using so many join commands?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243860#M189044</link>
      <description>&lt;P&gt;Try to fetch it all at once and then merge;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:AppAssureMonitoring" 
(host="AppAssure1" AND EventCode=350)
OR (host="AppAssure2" AND EventCode=150)
| dedup host, EventCode, ServerName
| eval Repo-{host} = RepositoryName
| stats values(AgentStatus) as AgentStatus values(Version) as Version values(Repo-AppAssure1) as LocalRepositoryName(..blahblah)  by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for the second;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:AppAssureMonitoring" EventCode=250
(host="AppAssure1" OR host="AppAssure2")
| dedup host, EventCode, ServerName
| eval ExportTime-{host} = ExportedTimeStamp
| eval ExportStatus-{host} = ExportedStatus
| stats values(ExportTime-AppAssure1) as LocalExportedTimeStamp (..blahblah) by ServerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And if you need it faster,&lt;BR /&gt;
you can save the search as a report and accelerate it, &lt;BR /&gt;
or schedule the search and save the results in a lookup.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 14:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243860#M189044</guid>
      <dc:creator>mhpark</dc:creator>
      <dc:date>2016-08-24T14:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I run this query more efficiently without using so many join commands?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243861#M189045</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:AppAssureMonitoring" (host="AppAssure1" EventCode=350 OR EventCode=250) OR (host="AppAssure2"  EventCode=150 OR EventCode=250) 
| fields ServerName EventCode host AgentStatus Version LatestSnapshot IsPaused LatestSnapshotStatus  RepositoryName ReplicatedStatus ReplicatedTimeStamp ExportedTimeStamp ExportedStatus
| dedup ServerName host EventCode 
| eval LocalRepositoryName=if(host="AppAssure1" AND EventCode="350",RepositoryName,null())
| eval LocalExportedTimeStamp=if(host="AppAssure1" AND EventCode="250",ExportedTimeStamp,null())
| eval LocalExportedStatus=if(host="AppAssure1" AND EventCode="250",ExportedStatus,null())
| eval ReplicaExportedTimeStamp=if(host="AppAssure2" AND EventCode="250",ExportedTimeStamp,null())
| eval ReplicaExportedStatus=if(host="AppAssure2" AND EventCode="250",ExportedStatus,null())
| stats values(*) as * by ServerName | fields - EventCode host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Aug 2016 15:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243861#M189045</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-24T15:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I run this query more efficiently without using so many join commands?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243862#M189046</link>
      <description>&lt;P&gt;Wow that's amazing!!!! So much quicker and I get all the info I needed.&lt;/P&gt;

&lt;P&gt;Thanks very much, our OpsTeam will salute you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 15:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-run-this-query-more-efficiently-without-using-so-many/m-p/243862#M189046</guid>
      <dc:creator>kltest</dc:creator>
      <dc:date>2016-08-24T15:35:42Z</dc:date>
    </item>
  </channel>
</rss>

