<?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: Join two seaches with a range time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402741#M116542</link>
    <description>&lt;P&gt;I found a solution. I use an append to unify the two SPL, sort by &lt;STRONG&gt;_time&lt;/STRONG&gt; and use transaction with &lt;STRONG&gt;startswith=eval(match())&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;That do the trick.&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Nov 2018 11:50:57 GMT</pubDate>
    <dc:creator>slorente</dc:creator>
    <dc:date>2018-11-30T11:50:57Z</dc:date>
    <item>
      <title>Join two seaches with a range time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402739#M116540</link>
      <description>&lt;P&gt;Hello there.&lt;/P&gt;

&lt;P&gt;I have reading some answers similar to mine, but none of them fit with what I have in mind.&lt;/P&gt;

&lt;P&gt;I have two searches, both of them in different indexes.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Search A:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA field1="value1" (field2="value2" OR field3="value3)
| eval _time=strptime(fieldTime,"%Y-%m-%d %H:%M:%S")
| eval ID=field4.field5.field6
| stats latest(field7) as F7, latest(field8) as F8, latest(field9) as EstimatedTime by ID 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Search B:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexB AND NOT ("some_value1" OR "some_value2") earliest=1 latest=now
| dedup _time
| append [
    search index=indexB "some_value1" OR "some_value2" earliest=1 latest=now
    | dedup _time
    | transaction maxpause=1h maxevents=2
    | where eventcount=2
    | search F8="*" field10="*"
    | lookup some_lookup.csv field11 as F8 field12 as F12 OUTPUT field13 as F13
    | search F13="*"
]
| lookup some_lookup.csv field11 as F8 field12 as F12 OUTPUT field13 as F13
| streamstats last(_time) as InitialTime first(_time) as FinalTime window=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to check if the EstimatedTime field from the search 1 is in the range of the time fields InitialTime and FinalTime from the second search to asign the correct data. How could I get this?&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 17:00:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402739#M116540</guid>
      <dc:creator>slorente</dc:creator>
      <dc:date>2018-11-25T17:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join two seaches with a range time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402740#M116541</link>
      <description>&lt;P&gt;@slorente  - EDIT - &lt;/P&gt;

&lt;P&gt;I didn't realize this but if you have a code block inside - or even near - a list, it seems to break the code block.&lt;/P&gt;

&lt;P&gt;I changed your post around just a bit to fix that, substituting &lt;STRONG&gt;bold&lt;/STRONG&gt; for those list items and all seems well enough now.&lt;/P&gt;

&lt;P&gt;-Rich&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 17:18:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402740#M116541</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2018-11-25T17:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join two seaches with a range time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402741#M116542</link>
      <description>&lt;P&gt;I found a solution. I use an append to unify the two SPL, sort by &lt;STRONG&gt;_time&lt;/STRONG&gt; and use transaction with &lt;STRONG&gt;startswith=eval(match())&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;That do the trick.&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 11:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-seaches-with-a-range-time/m-p/402741#M116542</guid>
      <dc:creator>slorente</dc:creator>
      <dc:date>2018-11-30T11:50:57Z</dc:date>
    </item>
  </channel>
</rss>

