<?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 join two rex results from different host and query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488895#M136545</link>
    <description>&lt;P&gt;I have two query...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx_prod host="foo.org" 5032 submit | rex "id=PO:(?&amp;lt;PO&amp;gt;\d*)" | dedup PO | table PO _time

index=xxx_prod host="bar.org" | rex "savePO.*POId=(?&amp;lt;PO&amp;gt;\d*).*\"responseCode\":200" | dedup PO | table PO _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to compare both  PO results from different services one is submitted, another one is saved. and I want to show as the following table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    PO  | submit_date             | save_date               | elapse_time_min | isSave   
1000001 | 2020-01-18 02:09:49.022 | 2020-01-18 02:51:51.289 | 41              | true
1000002 | 2020-01-18 03:18:25.780 | 2020-01-18 03:59:08.695 | 49              | true
1000003 | 2020-01-18 03:18:25.780 |                         |                 | false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I do that?&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jan 2020 12:05:18 GMT</pubDate>
    <dc:creator>x_tivity</dc:creator>
    <dc:date>2020-01-18T12:05:18Z</dc:date>
    <item>
      <title>join two rex results from different host and query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488895#M136545</link>
      <description>&lt;P&gt;I have two query...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx_prod host="foo.org" 5032 submit | rex "id=PO:(?&amp;lt;PO&amp;gt;\d*)" | dedup PO | table PO _time

index=xxx_prod host="bar.org" | rex "savePO.*POId=(?&amp;lt;PO&amp;gt;\d*).*\"responseCode\":200" | dedup PO | table PO _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to compare both  PO results from different services one is submitted, another one is saved. and I want to show as the following table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    PO  | submit_date             | save_date               | elapse_time_min | isSave   
1000001 | 2020-01-18 02:09:49.022 | 2020-01-18 02:51:51.289 | 41              | true
1000002 | 2020-01-18 03:18:25.780 | 2020-01-18 03:59:08.695 | 49              | true
1000003 | 2020-01-18 03:18:25.780 |                         |                 | false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 12:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488895#M136545</guid>
      <dc:creator>x_tivity</dc:creator>
      <dc:date>2020-01-18T12:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: join two rex results from different host and query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488896#M136546</link>
      <description>&lt;P&gt;Show us some sample events from each sourcetype.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 19:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488896#M136546</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-01-18T19:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: join two rex results from different host and query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488897#M136547</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=xxx_prod (host="foo.org" 5032 submit) OR (host="bar.org")
| rex "id=PO:(?&amp;lt;submit_PO&amp;gt;\d*)"
| rex "savePO.*POId=(?&amp;lt;save_PO&amp;gt;\d*).*\"responseCode\":200"
| eval PO=coalesce(submit_PO,save_PO)
| eval flag=if(searchmatch("savePO"),"save","submit")
| stats earliest(eval(if(flag="submit",_time,NULL))) as submit_date latest(eval(if(flag="save",_time,NULL))) as save_date by PO
| eval elapse_time_min=round(save_date - submit_date / 60)
| eval isSave=if(isnull(elapse_time_min),"false","true")
| table PO submit_date save_date elapse_time_min isSave
| foreach *date
    [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=strftime(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,"%F %T.%3Q")]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/36202"&gt;@x_tivity&lt;/a&gt;&lt;BR /&gt;
It would be a little easier if &lt;EM&gt;save&lt;/EM&gt; and &lt;EM&gt;submit&lt;/EM&gt; were determined by the host name.&lt;BR /&gt;
Since I don't know the actual log,&lt;BR /&gt;
First time for &lt;EM&gt;submit&lt;/EM&gt; and Last time for &lt;EM&gt;save&lt;/EM&gt;  are counted.&lt;BR /&gt;
how about this&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-rex-results-from-different-host-and-query/m-p/488897#M136547</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T03:45:24Z</dc:date>
    </item>
  </channel>
</rss>

