<?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: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211292#M61787</link>
    <description>&lt;P&gt;Thanks, list(_raw)  helps and  it is the closest to what i was looking for. But it turned out that when the timings are same for multiple events then in that case I need a solution outside of splunk.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2016 22:33:44 GMT</pubDate>
    <dc:creator>justsshary</dc:creator>
    <dc:date>2016-09-27T22:33:44Z</dc:date>
    <item>
      <title>How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211283#M61778</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to extract sequence of events from logs by using &lt;CODE&gt;transaction&lt;/CODE&gt; command. I am looking for sequence of six events. It works well as long as the first and the last events are not the same but when they are same, it just lists every line in the log individually matching the value in the &lt;STRONG&gt;startswith&lt;/STRONG&gt;/&lt;STRONG&gt;endswith&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Here is my search :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex source=/my/folder/raw.log.gz xxx.xxx.xxx.xxx | sort -Time | eval ip="xxx.xxx.xxx.xxx" | transaction ip startswith="win_event=4624" endswith="win_event=4624" maxevents=6| search eventcount=6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this search, I am searching for all the logs for an IP, sorting them (as transaction returns an error if not sorted), creating an IP field as it is not there, and generating a transaction for this IP to extract log lines that have &lt;CODE&gt;win_event=4624&lt;/CODE&gt; as starting and ending event.   I want all the six events including 4624 that occur between two 4624.  This search only works when &lt;STRONG&gt;startswith&lt;/STRONG&gt; and &lt;STRONG&gt;endswith&lt;/STRONG&gt; do not have the same value.&lt;/P&gt;

&lt;P&gt;I also tried the following variation but it didn't work either:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort -Time | eval ip="xxx.xxx.xxx.xxx" | streamstats window=6 current=true last(win_event) AS win_event_last first(win_event) AS win_event_first | transaction startswith="win_event_first=4624" endswith="win_event_last=4624" maxevents=6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or is it possible to list only the records (log lines) that occur one after each other in a order with the given events for an ip?  E.g., if 4624, 4434, 4124, 4771, 1006, 4264  all appear one after another with the same ip on different log records.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 21:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211283#M61778</guid>
      <dc:creator>justsshary</dc:creator>
      <dc:date>2016-09-22T21:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211284#M61779</link>
      <description>&lt;P&gt;Can we have some sample (may be mock) events?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 02:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211284#M61779</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-23T02:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211285#M61780</link>
      <description>&lt;P&gt;not sure, but, may be try this - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction startswith=eval(match(_raw, "win\_event\_first\=4624")) endswith="win_event_last=4624"

| transaction startswith=eval(match(_raw, "win\_event\_first\=\d{4}")) endswith=(match(_raw, "win\_event\_first\=\d{4}")) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2016 03:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211285#M61780</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-09-23T03:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211286#M61781</link>
      <description>&lt;P&gt;192.168.1.2      4444&lt;BR /&gt;
192.168.100.1   4624&lt;BR /&gt;
192.168.100.1   4624&lt;BR /&gt;
192.168.1.1   5000&lt;BR /&gt;
192.168.100.1   4624&lt;BR /&gt;
192.168.100.1   4434&lt;BR /&gt;
192.168.100.1   4124&lt;BR /&gt;
192.168.100.1   4471&lt;BR /&gt;
192.168.100.1   1006&lt;BR /&gt;
192.168.100.1   4624&lt;/P&gt;

&lt;P&gt;See above example, I am interested in getting the sequence of log records for the IP: 192.168.100.1 starting from 4624 and ending at 4624 with a total of six events. This means the last six lines in the above case. &lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 03:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211286#M61781</guid>
      <dc:creator>justsshary</dc:creator>
      <dc:date>2016-09-23T03:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211287#M61782</link>
      <description>&lt;P&gt;I assume that want you want to do here is create a sliding window of 6 events and select those windows that start with 4624 and end with 4624. Given that you cannot do this with transaction (if you use the same &lt;CODE&gt;startswith&lt;/CODE&gt; and &lt;CODE&gt;endswith&lt;/CODE&gt; it gives all transactions to be single events), I will try to show you how you can do this using &lt;CODE&gt;streamstats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;
index=myindex source=/my/folder/raw.log.gz xxx.xxx.xxx.xxx | sort -Time | eval ip="xxx.xxx.xxx.xxx" | streamstats list(win_event) as event_window window=6 by ip | eval window_len=mvcount(event_window) |  eval window_first=mvindex(event_window, 0) | eval window_last=mvindex(event_window, 5)  | where window_len = 6 AND window_first=4624 AND window_last=4624
&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2016 04:42:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211287#M61782</guid>
      <dc:creator>mIliofotou_splu</dc:creator>
      <dc:date>2016-09-23T04:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211288#M61783</link>
      <description>&lt;P&gt;It is only returning individual lines with the given last event.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 22:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211288#M61783</guid>
      <dc:creator>justsshary</dc:creator>
      <dc:date>2016-09-23T22:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211289#M61784</link>
      <description>&lt;P&gt;Yes, It will be individual lines. Each of those lines will be the ending of sequence of 6 events where the starting event was a login 4624 and the last one (the current event you see) is the next 4624 login. &lt;/P&gt;

&lt;P&gt;Do you need all the raw events? I though you only needed the event codes between and the fact that such sequences exist. Both of those are given by the SPL above. If you need the raw events you might want to use a transaction instead of a "where" command. &lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2016 19:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211289#M61784</guid>
      <dc:creator>mIliofotou_splu</dc:creator>
      <dc:date>2016-09-24T19:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211290#M61785</link>
      <description>&lt;P&gt;Yes, I need all the logs records for all the events.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 01:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211290#M61785</guid>
      <dc:creator>justsshary</dc:creator>
      <dc:date>2016-09-25T01:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211291#M61786</link>
      <description>&lt;P&gt;You can keep your raw events by adding an extra &lt;CODE&gt;list(_raw) as other_events&lt;/CODE&gt; next to  &lt;CODE&gt;list(win_event)&lt;/CODE&gt;. This way, when you detect the last event of the window you will have the remaining events of the window under &lt;CODE&gt;other_events&lt;/CODE&gt;. In the meanwhile, I will try to see if there is a better way to do this. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211291#M61786</guid>
      <dc:creator>mIliofotou_splu</dc:creator>
      <dc:date>2016-09-26T16:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my transaction search to extract a sequence of six events when startswith and endswith have a matching value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211292#M61787</link>
      <description>&lt;P&gt;Thanks, list(_raw)  helps and  it is the closest to what i was looking for. But it turned out that when the timings are same for multiple events then in that case I need a solution outside of splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 22:33:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-transaction-search-to-extract-a-sequence-of-six/m-p/211292#M61787</guid>
      <dc:creator>justsshary</dc:creator>
      <dc:date>2016-09-27T22:33:44Z</dc:date>
    </item>
  </channel>
</rss>

