<?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 Transaction by source, sourcetype, day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176641#M50742</link>
    <description>&lt;P&gt;Following query has been used to calculate duration for individual source (input files) for last 5 days:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index" earliest=-5d  latest=now| transaction source maxevents=-1 | eval day=strftime(_time,"%m/%d/%Y")| sort - day sourcetype| table day,sourcetype,source,duration 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only transaction by source is used, hoping it would capture all the input files which have unique file name, thus separating its sourcetype and date.&lt;/P&gt;

&lt;P&gt;Basically, just need to display duration  per individual source file per sourcetype per day.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Sanjay &lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2013 15:45:12 GMT</pubDate>
    <dc:creator>sanjay_shrestha</dc:creator>
    <dc:date>2013-12-12T15:45:12Z</dc:date>
    <item>
      <title>Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176641#M50742</link>
      <description>&lt;P&gt;Following query has been used to calculate duration for individual source (input files) for last 5 days:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index" earliest=-5d  latest=now| transaction source maxevents=-1 | eval day=strftime(_time,"%m/%d/%Y")| sort - day sourcetype| table day,sourcetype,source,duration 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only transaction by source is used, hoping it would capture all the input files which have unique file name, thus separating its sourcetype and date.&lt;/P&gt;

&lt;P&gt;Basically, just need to display duration  per individual source file per sourcetype per day.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Sanjay &lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176641#M50742</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2013-12-12T15:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176642#M50743</link>
      <description>&lt;P&gt;Because you have no limit to the number of events in your transaction, and because you have no start and end points for your transactions, and furthermore you have nothing limiting the transactions other than "source", then you are going to get 1 event (transaction) per source value you have.&lt;/P&gt;

&lt;P&gt;You should calculate the day first, then use the day together with the source in your transaction. Like so:&lt;BR /&gt;
index="my_index" earliest=-5d  latest=now | eval day=strftime(_time,"%m/%d/%Y") | transaction source day maxevents=-1 | sort - day sourcetype| table day,sourcetype,source,duration&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:28:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176642#M50743</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2020-09-28T15:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176643#M50744</link>
      <description>&lt;P&gt;Now the above simply answers your question. I'm sure that there is a more efficient way of going about doing what you need, but I currently don't have time to work on it &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope the above helps.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176643#M50744</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-12-12T16:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176644#M50745</link>
      <description>&lt;P&gt;It worked by adding keepevicted=true to transaction command.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176644#M50745</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2013-12-12T16:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176645#M50746</link>
      <description>&lt;P&gt;There is a much more efficient way to do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_index" earliest=-5d  latest=now
| eval day=strftime(_time,"%m/%d/%Y")
| stats range(_time) as duration by day sourcetype source
| eval duration=tostring(duration,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is faster and more scalable.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 16:57:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176645#M50746</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-12-12T16:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction by source, sourcetype, day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176646#M50747</link>
      <description>&lt;P&gt;Thanks. It worked better that using transaction.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 17:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-by-source-sourcetype-day/m-p/176646#M50747</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2013-12-12T17:23:11Z</dc:date>
    </item>
  </channel>
</rss>

