<?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: using transaction in subsearch to define earliest latest in mainsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565647#M197101</link>
    <description>&lt;P&gt;Yes, the results of the subsearch are directly inserted as parameters for search. I can't find it specified anywhere explicitly but it looks that if the resulting set contains multiple fields, they are added with an implicit AND (like in your case - earliest=something AND latest=something) but if you have multiple rows of the same column, they are added with an implicit OR&lt;/P&gt;&lt;PRE&gt;index=windows [ index=windows | stats top 2 source | table source ]&lt;/PRE&gt;&lt;P&gt;Should search for events that have their source field set to one of two most often appearing values.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 10:15:01 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2021-09-02T10:15:01Z</dc:date>
    <item>
      <title>using transaction in subsearch to define earliest latest in mainsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565638#M197093</link>
      <description>&lt;P&gt;I want to use the subsearch to get start and endtime of the newest transaction (here a botsession).&lt;/P&gt;&lt;P data-unlink="true"&gt;The subsearch alone gives me:&lt;BR /&gt;starttime=&amp;nbsp;&amp;nbsp;09/01/2021:17:28:49&lt;BR /&gt;endtime= 09/01/2021:19:42:50&lt;/P&gt;&lt;P data-unlink="true"&gt;At first i used the subsearch without strftime()&lt;BR /&gt;but Splunk said earliest/latest cant parse epochtime and that it wants format&amp;nbsp;%m/%d/%Y:%H:%M:%S&lt;/P&gt;&lt;P data-unlink="true"&gt;that brings me to my current search where splunk says "&lt;SPAN&gt;Invalid value "starttime" for time term 'earliest'"&lt;BR /&gt;When i use the results of the subsearch when running alone it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;How can i make use of the start-/endtime?&lt;BR /&gt;Or is there a better method to limit my mainsearch for the newest botsession?&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;My Search (not the final search, but i want to work with the events from a specific session):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;index="fishingbot"&lt;BR /&gt;&amp;nbsp; [search index=fishingbot&lt;BR /&gt;&amp;nbsp; | transaction startswith="Anmeldung erfolgreich!" endswith="deaktiviert!"&lt;BR /&gt;&amp;nbsp; | eval endtime=strftime((_time+duration), "%m/%d/%Y:%H:%M:%S")&lt;BR /&gt;&amp;nbsp; | eval starttime=strftime(_time, "%m/%d/%Y:%H:%M:%S")&lt;BR /&gt;&amp;nbsp; | top starttime endtime limit=1&lt;BR /&gt;&amp;nbsp; | table starttime endtime]&lt;BR /&gt;earliest=starttime latest=endtime&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 09:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565638#M197093</guid>
      <dc:creator>TheEggi98</dc:creator>
      <dc:date>2021-09-02T09:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: using transaction in subsearch to define earliest latest in mainsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565643#M197097</link>
      <description>&lt;P&gt;Just return properly named fields from your subsearch. So don't do&lt;/P&gt;&lt;PRE&gt;[[...] | table start end ] earliest=start latest=end&lt;/PRE&gt;&lt;P&gt;Because it won't work.&lt;/P&gt;&lt;P&gt;Do&lt;/P&gt;&lt;PRE&gt;[[...] | table start end | rename start as earliest | rename end as latest ] &lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Sep 2021 09:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565643#M197097</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-02T09:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: using transaction in subsearch to define earliest latest in mainsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565644#M197098</link>
      <description>&lt;P&gt;Thanks! That works.&lt;/P&gt;&lt;P&gt;So with naming the times in the subsearch to earliest/latest splunk will automatically use them as timerange.&lt;/P&gt;&lt;P&gt;Good to know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 10:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565644#M197098</guid>
      <dc:creator>TheEggi98</dc:creator>
      <dc:date>2021-09-02T10:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: using transaction in subsearch to define earliest latest in mainsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565647#M197101</link>
      <description>&lt;P&gt;Yes, the results of the subsearch are directly inserted as parameters for search. I can't find it specified anywhere explicitly but it looks that if the resulting set contains multiple fields, they are added with an implicit AND (like in your case - earliest=something AND latest=something) but if you have multiple rows of the same column, they are added with an implicit OR&lt;/P&gt;&lt;PRE&gt;index=windows [ index=windows | stats top 2 source | table source ]&lt;/PRE&gt;&lt;P&gt;Should search for events that have their source field set to one of two most often appearing values.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 10:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-transaction-in-subsearch-to-define-earliest-latest-in/m-p/565647#M197101</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-02T10:15:01Z</dc:date>
    </item>
  </channel>
</rss>

