<?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 Start timer with transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329120#M97963</link>
    <description>&lt;P&gt;Hi guys, &lt;/P&gt;

&lt;P&gt;I need help cause I want  start a timer when i have one values and  end this same timer  when this values is different.&lt;BR /&gt;&lt;BR /&gt;
I would use the function Transaction but i think it's not the better solution. &lt;/P&gt;

&lt;P&gt;Exemple: When the weither have the value 2 i start the timer and when the weither take after the values 1 i stop the timer. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="xxx" 
|fields logs{}.projectId,logs{}.newWeatherId
|transaction logs{}.projectId startswith=eval(logs{}.newWeatherId="2") endswith=eval(logs{}.newWeatherId!=2) keepevicted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your answers.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2017 09:05:11 GMT</pubDate>
    <dc:creator>Abarny</dc:creator>
    <dc:date>2017-04-13T09:05:11Z</dc:date>
    <item>
      <title>Start timer with transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329120#M97963</link>
      <description>&lt;P&gt;Hi guys, &lt;/P&gt;

&lt;P&gt;I need help cause I want  start a timer when i have one values and  end this same timer  when this values is different.&lt;BR /&gt;&lt;BR /&gt;
I would use the function Transaction but i think it's not the better solution. &lt;/P&gt;

&lt;P&gt;Exemple: When the weither have the value 2 i start the timer and when the weither take after the values 1 i stop the timer. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="xxx" 
|fields logs{}.projectId,logs{}.newWeatherId
|transaction logs{}.projectId startswith=eval(logs{}.newWeatherId="2") endswith=eval(logs{}.newWeatherId!=2) keepevicted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your answers.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 09:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329120#M97963</guid>
      <dc:creator>Abarny</dc:creator>
      <dc:date>2017-04-13T09:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Start timer with transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329121#M97964</link>
      <description>&lt;P&gt;transaction creates a default field called duration which captures what you are intending. Just pipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table logs{}.projectID eventcount duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, better way would be to go for stats command to handle such scenarios which will perform better.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 10:03:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329121#M97964</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-04-13T10:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Start timer with transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329122#M97965</link>
      <description>&lt;P&gt;you could try using the &lt;CODE&gt;maxspan&lt;/CODE&gt; and &lt;CODE&gt;maxpause&lt;/CODE&gt; options in transaction but i'm not sure that's really what you're going for.&lt;/P&gt;

&lt;P&gt;If you're using v6.5, try using streamstats. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Streamstats" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.3/SearchReference/Streamstats&lt;/A&gt;&lt;BR /&gt;
The reset_on_change command might be what you need.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Start-timer-with-transaction/m-p/329122#M97965</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T13:39:09Z</dc:date>
    </item>
  </channel>
</rss>

