<?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: Capture text between events in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194001#M12106</link>
    <description>&lt;P&gt;try using the &lt;CODE&gt;_indextime&lt;/CODE&gt; field as additional transaction field if there is no other field in common over all events&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jun 2014 13:21:47 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-06-10T13:21:47Z</dc:date>
    <item>
      <title>Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193992#M12097</link>
      <description>&lt;P&gt;I have some logs being indexed that contain the output from another program, and Splunk indexes like this:&lt;/P&gt;

&lt;P&gt;Event 1: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;commandOuput=
/some/random/command blah blah blah
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;line1 output from the command
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event 3:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;line2 output from the command
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event XX:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lineXX output from the command
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event Z:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;commandExitcode=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to capture and concatenate all text between the first event, and the last event (Z).  I've tried using &lt;CODE&gt;transaction&lt;/CODE&gt;  and matched the start with &lt;CODE&gt;startswith&lt;/CODE&gt; and end with &lt;CODE&gt;endswith&lt;/CODE&gt;, but that only seems to keep the start and end event, not the events inbetween.&lt;/P&gt;

&lt;P&gt;Is there an easier way of just extracting the raw data between two events?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 08:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193992#M12097</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T08:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193993#M12098</link>
      <description>&lt;P&gt;Hi Kindred,&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | rex field=_raw "Event\s1\:(?&amp;lt;myNewField).*)Event\sZ\:" | table myNewField
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will get everything between &lt;CODE&gt;Event 1:&lt;/CODE&gt;  and &lt;CODE&gt;Event Z:&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;BR /&gt;
cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 08:20:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193993#M12098</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T08:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193994#M12099</link>
      <description>&lt;P&gt;Sorry didn't meant "Event .." was in the text, I was just identifying them as different events from Splunk's point of view.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 08:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193994#M12099</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T08:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193995#M12100</link>
      <description>&lt;P&gt;well, then try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | rex field=_raw "commandOuput=(?&amp;lt;myNewField).*)commandExitcode=0" | table myNewField
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jun 2014 08:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193995#M12100</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T08:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193996#M12101</link>
      <description>&lt;P&gt;That doesn't seem to match anything.  If I remove &lt;CODE&gt;commandExitcode&lt;/CODE&gt; then it matches the first line in the first event, but nothing after.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 09:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193996#M12101</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T09:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193997#M12102</link>
      <description>&lt;P&gt;My bad, there is a typo and a copy / paste error in it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;This one is tested with your provided example and it works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"commandOuput=(\r)+(?&amp;lt;myField&amp;gt;(.+\r)+)(\r)+commandExitcode=0"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jun 2014 09:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193997#M12102</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T09:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193998#M12103</link>
      <description>&lt;P&gt;I can see what you're trying to do and I've done regex extractions before, but it still won't extract over multiple events - it only pulls out the first line of the first event.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 12:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193998#M12103</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T12:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193999#M12104</link>
      <description>&lt;P&gt;Sorry it is way to hot in the office to have a clear thought &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Now I see your problem, this pasted example is not the raw test of one event, those are different events &lt;EM&gt;facepalm&lt;/EM&gt;&lt;BR /&gt;
So keep the transaction with startswith and endswith and create or use a common field for all the other events you need. Add this field to the transaction command like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transaction startswith="commandOuput=" endswith="commandExitcode=0" thenewfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where the &lt;CODE&gt;newfield&lt;/CODE&gt; cound be for example a regex for &lt;CODE&gt;line1 output&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;hope this makes sense now&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 12:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/193999#M12104</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194000#M12105</link>
      <description>&lt;P&gt;We don't have control over the "command output" that gets logged, so no way to tag it for consideration in the transaction - that's why I originally had trouble, I could match the start and end transaction events, but the text "in between" the events can't be correlated.  &lt;/P&gt;

&lt;P&gt;What I need is like saying "give me all the events between startswith=foo and endswith=bar regardless of whats in the events".&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 13:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194000#M12105</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T13:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194001#M12106</link>
      <description>&lt;P&gt;try using the &lt;CODE&gt;_indextime&lt;/CODE&gt; field as additional transaction field if there is no other field in common over all events&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 13:21:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194001#M12106</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T13:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194002#M12107</link>
      <description>&lt;P&gt;&lt;CODE&gt;_indextime&lt;/CODE&gt; changes over the course of time as the command output is logged, so won't help unfortunately.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 13:29:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194002#M12107</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T13:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194003#M12108</link>
      <description>&lt;P&gt;take this run everywhere search and you will see that using &lt;CODE&gt;_indextime&lt;/CODE&gt; works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*access.log | transaction clientip _indextime maxspan=5min
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by using it with startswith and endswith you should be able to get what you want&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 13:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194003#M12108</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-06-10T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Capture text between events</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194004#M12109</link>
      <description>&lt;P&gt;I tried, it doesn't change anything - it still only gives me the first event (startswith) and last events (endswith) - the events in between are not included.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2014 14:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Capture-text-between-events/m-p/194004#M12109</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2014-06-10T14:15:36Z</dc:date>
    </item>
  </channel>
</rss>

