<?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: Filter events in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Filter-events/m-p/669130#M2630</link>
    <description>&lt;P&gt;To dIagnose these problems run the outer search on its own and the inner search on its own.&lt;/P&gt;&lt;P&gt;You are using join, which is not necessary and may be the issue depending on your data size.&lt;/P&gt;&lt;P&gt;You don't need the table commands all the time and you seem to be duplicating your time parsing (time and _time).&lt;/P&gt;&lt;P&gt;Not sure you need reverse either - in the join, you are reversing to get the first timestamp, which in practice without the reverse would be the oldest _time, so you could just to earliest(timestamp) instead without reverse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 00:52:24 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-11-20T00:52:24Z</dc:date>
    <item>
      <title>Filter events</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Filter-events/m-p/669023#M2629</link>
      <description>&lt;P&gt;Device_ID : 1 A.txt&lt;/P&gt;
&lt;P&gt;2021-07-06 23:30:34.2379| Started!&lt;BR /&gt;2021-07-06 23:30:34.6808|3333|-0.051|0.051|0.008|0.016&lt;/P&gt;
&lt;P&gt;Device_ID : 1 E.txt&lt;/P&gt;
&lt;P&gt;2021-07-13 18:28:26.7769|**&lt;BR /&gt;2021-07-13 18:28:27.1363|aa&lt;/P&gt;
&lt;P&gt;Device_ID : 2 E.txt&lt;/P&gt;
&lt;P&gt;2016-03-02 13:56:06.9283|**&lt;BR /&gt;2016-03-02 13:56:07.3333|ff&lt;/P&gt;
&lt;P&gt;Device_ID : 2 A.txt&lt;/P&gt;
&lt;P&gt;2020-03-02 13:42:30.0111| Started!&lt;BR /&gt;2020-03-02 13:42:30.0111|444|-0.051|0.051|0.008|0.016&lt;/P&gt;
&lt;P&gt;Query:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="xx" source="*A.txt"
| eval Device_ID=mvindex(split(source,"/"),5)
| reverse
| table Device_ID _raw
| rex field=_raw "(?&amp;lt;timestamp&amp;gt;[^|]+)\|(?&amp;lt;Probe_ID&amp;gt;[^|]+)"
| table Device_ID timestamp Probe_ID
| rex mode=sed field=timestamp "s/\\\\x00/ /g"
| table Device_ID timestamp Probe_ID
| eval time=strptime(timestamp,"%F %T.%4N")
| streamstats global=f max(time) as latest_time by Device_ID
| where time &amp;gt;= latest_time
| eval _time=strptime(timestamp,"%Y-%m-%d %H:%M:%S.%4N")
| table Device_ID _time Probe_ID
|join type=left Device_ID [ search index="xx" source="*E.txt"
| eval Device_ID=mvindex(split(source,"/"),5)
| reverse
| rex field=_raw "(?&amp;lt;timestamp&amp;gt;[^|]+)"
| stats first(timestamp) as earliesttime last(timestamp) as latesttime by Device_ID
|table Device_ID earliesttime latesttime
]
|where _time &amp;gt;= strptime(earliesttime, "%Y-%m-%d %H:%M:%S.%4N") AND _time &amp;lt;= strptime(latesttime, "%Y-%m-%d %H:%M:%S.%4N")

|search Device_ID="1"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filtering events based on E.txt earliest timestamp on A.txt.&lt;/P&gt;
&lt;P&gt;It is working for Device_ID 1 and not for Device_ID 2.&lt;/P&gt;
&lt;P&gt;Both logs are same format.&lt;/P&gt;
&lt;P&gt;It is not generating earliest and latest timestamp for device_ID 2. If i run subsearch alone, it is generating.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 17:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Filter-events/m-p/669023#M2629</guid>
      <dc:creator>kirthika26</dc:creator>
      <dc:date>2023-11-17T17:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Filter-events/m-p/669130#M2630</link>
      <description>&lt;P&gt;To dIagnose these problems run the outer search on its own and the inner search on its own.&lt;/P&gt;&lt;P&gt;You are using join, which is not necessary and may be the issue depending on your data size.&lt;/P&gt;&lt;P&gt;You don't need the table commands all the time and you seem to be duplicating your time parsing (time and _time).&lt;/P&gt;&lt;P&gt;Not sure you need reverse either - in the join, you are reversing to get the first timestamp, which in practice without the reverse would be the oldest _time, so you could just to earliest(timestamp) instead without reverse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 00:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Filter-events/m-p/669130#M2630</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-20T00:52:24Z</dc:date>
    </item>
  </channel>
</rss>

