<?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: Transaction Duration Duplicated due to multiple same event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156575#M44042</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I already tested :  dedup color&lt;BR /&gt;
But the result is not what i expected.&lt;BR /&gt;
can you give more informations about dedup filters ? &lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2013 14:53:25 GMT</pubDate>
    <dc:creator>YoussefB</dc:creator>
    <dc:date>2013-11-26T14:53:25Z</dc:date>
    <item>
      <title>Transaction Duration Duplicated due to multiple same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156573#M44040</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm trying to get the duration of a transaction starting with "&lt;EM&gt;green&lt;/EM&gt;" and stopping with "&lt;EM&gt;red&lt;/EM&gt;" :&lt;BR /&gt;
The problem is that when i have data like  this :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;time_001 Green&lt;/LI&gt;
&lt;LI&gt;time_002 Green&lt;/LI&gt;
&lt;LI&gt;time_003 Red&lt;/LI&gt;
&lt;LI&gt;time_004 Red&lt;/LI&gt;
&lt;LI&gt;time_005 Green&lt;/LI&gt;
&lt;LI&gt;time_006 Red&lt;/LI&gt;
&lt;LI&gt;time_007 Green&lt;/LI&gt;
&lt;LI&gt;time_008 Green&lt;/LI&gt;
&lt;LI&gt;time_009 Red&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The calculated duration is ko because of the duplicated events.&lt;BR /&gt;
This is my search query :&lt;BR /&gt;
host="Data_Host" "&lt;EM&gt;Connected&lt;/EM&gt;" &lt;BR /&gt;
| rex ="&lt;EM&gt;Host (?&lt;HOST&gt;.&lt;/HOST&gt;&lt;/EM&gt;) - (?&lt;COLOR&gt;.&lt;EM&gt;)" &lt;BR /&gt;
| transaction host startswith="*Green&lt;/EM&gt;" endswith="&lt;EM&gt;Red&lt;/EM&gt;" &lt;BR /&gt;
| stats sum(duration) as "uptime_duration" by ligneNum&lt;BR /&gt;
| convert timeformat="%d/%m/%y-%H:%M:%S" ctime(_time) AS "uptime_duration"&lt;BR /&gt;
| fieldformat uptime_duration=tostring(uptime_duration,"duration")&lt;/COLOR&gt;&lt;/P&gt;

&lt;P&gt;I want my transactions to ignore the same redondant successif colors.&lt;BR /&gt;
the result should be something like :&lt;BR /&gt;
 - time_001 Green&lt;BR /&gt;
 - time_003 Red&lt;BR /&gt;
 - time_005 Green&lt;BR /&gt;
 - time_006 Red&lt;BR /&gt;
 - time_007 Green&lt;BR /&gt;
 - time_009 Red&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156573#M44040</guid>
      <dc:creator>YoussefB</dc:creator>
      <dc:date>2020-09-28T15:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Duration Duplicated due to multiple same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156574#M44041</link>
      <description>&lt;P&gt;try &lt;EM&gt;dedup&lt;/EM&gt;; a filtering command for removing redundunt data that match specific criteria &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 14:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156574#M44041</guid>
      <dc:creator>ahrefai</dc:creator>
      <dc:date>2013-11-26T14:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Duration Duplicated due to multiple same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156575#M44042</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I already tested :  dedup color&lt;BR /&gt;
But the result is not what i expected.&lt;BR /&gt;
can you give more informations about dedup filters ? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 14:53:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156575#M44042</guid>
      <dc:creator>YoussefB</dc:creator>
      <dc:date>2013-11-26T14:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction Duration Duplicated due to multiple same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156576#M44043</link>
      <description>&lt;P&gt;I doubt if this is the most elegant way, it may not even be  a correct way (reading the documentation dedup should keep the most recent event) but using reverse prior to the dedup seems to keep the events you want (if time_001 is earlier than time_002).&lt;/P&gt;

&lt;P&gt;Try something like&lt;BR /&gt;
...&lt;BR /&gt;
| rex ="Host (?&lt;HOST&gt;.) - (?&lt;COLOR&gt;.)"&lt;BR /&gt;
| reverse&lt;BR /&gt;
| dedup color consecutive=t &lt;BR /&gt;
| sort -_time &lt;BR /&gt;
| transaction host startswith="Green" endswith="Red*" &lt;BR /&gt;
| ...&lt;/COLOR&gt;&lt;/HOST&gt;&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-Duration-Duplicated-due-to-multiple-same-event/m-p/156576#M44043</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2020-09-28T15:22:16Z</dc:date>
    </item>
  </channel>
</rss>

