<?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 - max span is 1 calendar day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443020#M125713</link>
    <description>&lt;P&gt;If you limit your search to a single day using &lt;CODE&gt;earliest=@d&lt;/CODE&gt; or &lt;CODE&gt;earliest=-1d latest=@d&lt;/CODE&gt; then the transaction will only have events from that day.&lt;/P&gt;

&lt;P&gt;You might try bucketing events before the transaction.  &lt;CODE&gt;... | bucket span=1d _time | transaction maxspan=1d ...&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 11 Aug 2019 13:31:00 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-08-11T13:31:00Z</dc:date>
    <item>
      <title>Transaction - max span is 1 calendar day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443019#M125712</link>
      <description>&lt;P&gt;Hi all, can I define somehow that I will get the only a transaction from the same calendar day?&lt;BR /&gt;
I know that I can use maxspan but, if I have two transactions:&lt;BR /&gt;
08-11-19 15:51&lt;BR /&gt;
08-12-19 00:02&lt;BR /&gt;
I would like that it will not show me this transaction (and maxspan=1d/24m not helping me with that).&lt;/P&gt;

&lt;P&gt;**&lt;STRONG&gt;&lt;EM&gt;Example *&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
so this is an example to my logs:&lt;BR /&gt;
1) 1/1/19 2:58 ON&lt;BR /&gt;
2) 1/1/19 11:31 OFF&lt;BR /&gt;
3) 1/1/19 13:21 ON&lt;BR /&gt;
4) 1/1/19 17:03 OFF&lt;BR /&gt;
5) 1/1/19 19:53 ON&lt;BR /&gt;
6) 1/2/19 5:17 OFF&lt;/P&gt;

&lt;P&gt;I wish to know for how long some users have been on state ON and on state OFF (going from ON to OFF is on and from OFF to ON is off) on the same day.&lt;BR /&gt;
here I would like to get:&lt;BR /&gt;
On 30780s (1-&amp;gt;2)&lt;BR /&gt;
Off 6660s (2-&amp;gt;3)&lt;BR /&gt;
On 13320s (3-&amp;gt;4)&lt;BR /&gt;
Off 10181s (4-&amp;gt;5)&lt;/P&gt;

&lt;P&gt;And I don't want that to show the transaction from 5 to 6 since it is not on the same date.&lt;BR /&gt;
Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 12:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443019#M125712</guid>
      <dc:creator>alisaf</dc:creator>
      <dc:date>2019-08-11T12:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction - max span is 1 calendar day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443020#M125713</link>
      <description>&lt;P&gt;If you limit your search to a single day using &lt;CODE&gt;earliest=@d&lt;/CODE&gt; or &lt;CODE&gt;earliest=-1d latest=@d&lt;/CODE&gt; then the transaction will only have events from that day.&lt;/P&gt;

&lt;P&gt;You might try bucketing events before the transaction.  &lt;CODE&gt;... | bucket span=1d _time | transaction maxspan=1d ...&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 13:31:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443020#M125713</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-11T13:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction - max span is 1 calendar day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443021#M125714</link>
      <description>&lt;P&gt;DO NOT USE the &lt;CODE&gt;transaction&lt;/CODE&gt; command.  Where is your SPL?  Show us your raw events and a mockup of your desired final output.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 20:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443021#M125714</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-11T20:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction - max span is 1 calendar day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443022#M125715</link>
      <description>&lt;P&gt;so this is an example to my logs:&lt;BR /&gt;
1) 1/1/19 2:58  ON&lt;BR /&gt;
2) 1/1/19 11:31 OFF&lt;BR /&gt;
3) 1/1/19 13:21 ON&lt;BR /&gt;
4) 1/1/19 17:03 OFF&lt;BR /&gt;
5) 1/1/19 19:53 ON&lt;BR /&gt;
6) 1/2/19 5:17  OFF&lt;/P&gt;

&lt;P&gt;I wish to know for how long some users have been on state ON and on state OFF (going from ON to OFF is on and from OFF to ON is off) on the same day.&lt;BR /&gt;
here I would like to get:&lt;BR /&gt;
On 30780s (1-&amp;gt;2)&lt;BR /&gt;
Off 6660s (2-&amp;gt;3)&lt;BR /&gt;
On 13320s (3-&amp;gt;4)&lt;BR /&gt;
Off 10181s (4-&amp;gt;5)&lt;/P&gt;

&lt;P&gt;And I don't want that to show the transaction from 5 to 6 since it is not in the same date.&lt;BR /&gt;
Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 06:27:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443022#M125715</guid>
      <dc:creator>alisaf</dc:creator>
      <dc:date>2019-08-12T06:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction - max span is 1 calendar day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443023#M125716</link>
      <description>&lt;P&gt;DO NOT use &lt;CODE&gt;transaction&lt;/CODE&gt;; do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
|  eval raw="time=1/1/19T2:58,state=ON time=1/1/19T11:31,state=OFF time=1/1/19T13:21,state=ON time=1/1/19T17:03,state=OFF time=1/1/19T19:53,state=ON time=1/2/19T5:17,state=OFF"
| makemv raw
| mvexpand raw
| rename raw AS _raw
| kv
| rename time AS _time
| eval _time = strptime(_time, "%m/%d/%yT%H:%M")
| sort 0 - _time

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval days = _time
| bin days span=1d
| streamstats count(eval(state="OFF")) AS transactionID
| stats values(*) AS * dc(days) AS day_count BY transactionID
| search day_count == 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 15:52:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-max-span-is-1-calendar-day/m-p/443023#M125716</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-12T15:52:28Z</dc:date>
    </item>
  </channel>
</rss>

