<?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: Combine 3 queries using a common field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525943#M148440</link>
    <description>&lt;P&gt;I think this is what I am looking at. Let me try.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 01:48:07 GMT</pubDate>
    <dc:creator>vinoths_82</dc:creator>
    <dc:date>2020-10-22T01:48:07Z</dc:date>
    <item>
      <title>Combine 3 queries using a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525463#M148294</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have 3 queries as below and all 3 of them have a common field "loaderId". I used join to combine their results in a table format and calculated P95 on their times. But I believe there has to be a better approach to this problem. Please let me know one.&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;index=* ... | search eventSource="Page Load" | |table eventSource, duration1, loaderId | join loaderId [search&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=* ... | search eventSource="End to End Time" | table eventSource, duration2, loaderId | join loaderId [&lt;/P&gt;&lt;P&gt;index=* ... | search eventSource="Total Time" table eventSource, duration3, loaderId] | table eventSource, duration1, duration2, duration3, loaderId | stats perc95(duration1), perc95(duration2), perc95(duration3)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 21:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525463#M148294</guid>
      <dc:creator>vinoths_82</dc:creator>
      <dc:date>2020-10-19T21:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 3 queries using a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525464#M148295</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225388"&gt;@vinoths_82&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess the devil's in the detail with your example, as the ... in the query might be significant, however, if you have duration 1,2,3 in your data then the simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* ... (eventSource="Page Load" OR eventSource="End to End Time" OR eventSource="Total Time")
| stats perc95(duration1), perc95(duration2), perc95(duration3) by loaderId&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would be a start - note I split by loaderId, which I am not sure is what you want. However, if you do not have the duration fields and the '...' is part of your duration calculation, then there's no reason why you could not calculate the durations by using eval/case, something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval duration1=if(eventSource="Page Load",xxx,null())
| eval duration2=if(eventSource="End to End Time",yyy,null())
| eval duration3=if(eventSource="Total Time",zzz,null())&lt;/LI-CODE&gt;&lt;P&gt;Not sure if this will get you to where you want to get to, but I would need a little more detail on your data, but hope it helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 22:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525464#M148295</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-10-19T22:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 3 queries using a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525943#M148440</link>
      <description>&lt;P&gt;I think this is what I am looking at. Let me try.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 01:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/525943#M148440</guid>
      <dc:creator>vinoths_82</dc:creator>
      <dc:date>2020-10-22T01:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Combine 3 queries using a common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/526529#M148604</link>
      <description>&lt;P&gt;I tried the above, but still I have some issues. Let me explain (what I missed to do above).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 3 different events being generated async. with their corresponding durations. They all share a common Id called "loaderId". see eg. below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Event Source LoaderId Duration&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Page Load 03904756 33.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Page Load 03904766 23.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;Event Source LoaderId Duration&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;End To End 03904756 33.4&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;Event Source LoaderId Duration&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Total Time 03904756 33.7&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above example, you can see there are 2 events in Page Load but only 1 for the other 2.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I used join using LoaderId, I get the final output like below.&lt;/P&gt;&lt;P&gt;LoaderId "Page Load Time"&amp;nbsp;"End to End Time"&amp;nbsp;"Total Time"&lt;/P&gt;&lt;P&gt;03904756 33.2&amp;nbsp;33.4&amp;nbsp;33.7&lt;/P&gt;&lt;P&gt;This eliminates rows from all events where there are no duration values in any of 3 event sources.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What Happened with previous Suggestion:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I tried to group by loaderId I see results like below&lt;/P&gt;&lt;P&gt;LoaderId "Page Load Time"&amp;nbsp;"End to End Time"&amp;nbsp;"Total Time"&lt;/P&gt;&lt;P&gt;03904756 33.2&amp;nbsp;33.4&amp;nbsp;33.7&lt;/P&gt;&lt;P&gt;03904766 23.2&lt;/P&gt;&lt;P&gt;I tried to remove the 2nd row by using len function or isnotnull for durations, but it didn't help. Let me know how I can get the result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 19:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-3-queries-using-a-common-field/m-p/526529#M148604</guid>
      <dc:creator>vinoths_82</dc:creator>
      <dc:date>2020-10-26T19:57:18Z</dc:date>
    </item>
  </channel>
</rss>

