<?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 How can SPL be written more efficiently to combine 3 source types? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470761#M132429</link>
    <description>&lt;P&gt;I am combining 3 source types. I've tried using  &lt;CODE&gt;|stats values()&lt;/CODE&gt; but can't seem to get it to work.&lt;/P&gt;

&lt;P&gt;Example of what I currently have written but it runs too slow.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=integration sourcetype=Incident
| join type=left Assignment_Group 
    [search index=integration sourcetype=Assignment
    | rename NAME AS Assignment_Group Team_Leader AS Leader_ID
    | join type=left Leader_ID
        [search index=integration sourcetype=ROLLUP_ORG_LEVELS
        | rename ID AS Leader_ID ]]
| dedup Incident_ID
| table Incident_ID Assignment_Group LVL3_MGR
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Apr 2020 17:41:37 GMT</pubDate>
    <dc:creator>wichniewicz</dc:creator>
    <dc:date>2020-04-09T17:41:37Z</dc:date>
    <item>
      <title>How can SPL be written more efficiently to combine 3 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470761#M132429</link>
      <description>&lt;P&gt;I am combining 3 source types. I've tried using  &lt;CODE&gt;|stats values()&lt;/CODE&gt; but can't seem to get it to work.&lt;/P&gt;

&lt;P&gt;Example of what I currently have written but it runs too slow.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=integration sourcetype=Incident
| join type=left Assignment_Group 
    [search index=integration sourcetype=Assignment
    | rename NAME AS Assignment_Group Team_Leader AS Leader_ID
    | join type=left Leader_ID
        [search index=integration sourcetype=ROLLUP_ORG_LEVELS
        | rename ID AS Leader_ID ]]
| dedup Incident_ID
| table Incident_ID Assignment_Group LVL3_MGR
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 17:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470761#M132429</guid>
      <dc:creator>wichniewicz</dc:creator>
      <dc:date>2020-04-09T17:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can SPL be written more efficiently to combine 3 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470762#M132430</link>
      <description>&lt;P&gt;hi @wichniewicz,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=integration sourcetype=Incident OR sourcetype=Assignment OR sourcetype=ROLLUP_ORG_LEVELS
| fields  Incident_ID, Assignment_Group, NAME, TEAM_LEADER, ID, LVL3_MGR
| eval Assignment_Group=coalesce(Assignment_Group, NAME) 
| eval TEAM_LEADER=coalesce(TEAM_LEADER, ID) 
| eventstats values(LVL3_MGR) AS LVL3_MGR BY TEAM_LEADER
| eventstats values(LVL3_MGR) AS LVL3_MGR BY Assignment_Group
| stats latest(LVL3_MGR) AS LVL3_MGR, latest(Assignment_Group) AS Assignment_Group BY Assignment_Group
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Apr 2020 19:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470762#M132430</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-04-09T19:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can SPL be written more efficiently to combine 3 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470763#M132431</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=integration (sourcetype=Incident OR sourcetype=Assignment OR sourcetype=ROLLUP_ORG_LEVELS)
| eval Leader_ID=coalesce(Leader_ID,Team_Leader,ID), Assignment_Group=coalesce(Assignment_Group, NAME)
| stats count(Leader_ID) as flag values(Assignment_Group) as Assignment_Group values(LVL3_MGR) as LVL3_MGR by Incident_ID
| search flag=3
| table Incident_ID Assignment_Group LVL3_MGR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your &lt;CODE&gt;join&lt;/CODE&gt; aims to find the &lt;EM&gt;Incident_ID&lt;/EM&gt; which has &lt;EM&gt;Leader_ID&lt;/EM&gt;.&lt;BR /&gt;
This query aims to find same .&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 21:11:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-SPL-be-written-more-efficiently-to-combine-3-source/m-p/470763#M132431</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-09T21:11:55Z</dc:date>
    </item>
  </channel>
</rss>

