<?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: Regex match till end of event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221276#M65045</link>
    <description>&lt;P&gt;Do you have a sample of one of the difficult, long, multi-line event that we can use for confirmation of potential solutions before posting them?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2016 15:16:29 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2016-08-10T15:16:29Z</dc:date>
    <item>
      <title>Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221267#M65036</link>
      <description>&lt;P&gt;Not sure why I cant find this, but the following is not working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "(?i)response=(?&amp;lt;responseXML&amp;gt;.+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where  response= occurs somewhere in the event and always continues to the very end of a multi lined event.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 03:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221267#M65036</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T03:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221268#M65037</link>
      <description>&lt;P&gt;"(?i)response=(?.+)$" ----- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;- you should use &amp;lt; and &amp;gt; around the variable - (?&amp;lt;i&amp;gt;) 
- (?&amp;lt;i&amp;gt;) needs to come where it will appear on the event (ie, after the "response=")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and i created few sample events ending with "response=digits"  &lt;/P&gt;

&lt;P&gt;event 1 - Extract "from" and "to" fields using regular expressions. response=101&lt;BR /&gt;
event 2 - If a raw event contains "From: Susan To: Bob", then from=Susan and to=Bob, response=404&lt;BR /&gt;
event 3 - source="tutorialdata.zip:./www1/access.log" response=500&lt;/P&gt;

&lt;P&gt;and this query picks up the response codes fine. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=responseREX | rex field=_raw "response=(?&amp;lt;i&amp;gt;.*)" | table _raw, i 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;regarding the end of line $, these below two works same - &lt;BR /&gt;
response=(?&lt;I&gt;.&lt;EM&gt;)&lt;BR /&gt;
and&lt;BR /&gt;
response=(?&lt;I&gt;.&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;)$&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 08:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221268#M65037</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-10T08:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221269#M65038</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "response=(?&amp;lt;msg&amp;gt;[^\t\n]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2016 13:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221269#M65038</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-10T13:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221270#M65039</link>
      <description>&lt;P&gt;Sorry, I had that, but I must have missed the code button and it stripped out some things.&lt;/P&gt;

&lt;P&gt;This is not working&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "(?m)Data=(?&amp;lt;xmlData&amp;gt;.+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2016 14:27:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221270#M65039</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T14:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221271#M65040</link>
      <description>&lt;P&gt;this does not work because it only captures to the end of the current line the response= is found in.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 14:29:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221271#M65040</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T14:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221272#M65041</link>
      <description>&lt;P&gt;This only captured the first character after response=&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 14:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221272#M65041</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T14:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221273#M65042</link>
      <description>&lt;P&gt;Have you tried erex?   &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Erex"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Erex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Using erex, Splunk will attempt to write the rex pattern for you given your example string(s).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 14:59:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221273#M65042</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-08-10T14:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221274#M65043</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=_raw "response=(?&amp;lt;responseXML&amp;gt;[\S\s\r\n]*)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | eval responseXML=replace(_raw,"^([\S\s\r\n]*)response=","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221274#M65043</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-10T15:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221275#M65044</link>
      <description>&lt;P&gt;Unfortunately, while useful for smaller more specific examples, this cannot take multiple 1000 character examples across multiple lines as input.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:13:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221275#M65044</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T15:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221276#M65045</link>
      <description>&lt;P&gt;Do you have a sample of one of the difficult, long, multi-line event that we can use for confirmation of potential solutions before posting them?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221276#M65045</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-08-10T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221277#M65046</link>
      <description>&lt;P&gt;we are trying to create the rex query with just our own understanding of your issue. &lt;BR /&gt;
could you please update us an event, and your current query, please.  &lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221277#M65046</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-10T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221278#M65047</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "response=(?&amp;lt;msg&amp;gt;[^\S\t\r\n]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2016 17:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221278#M65047</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-10T17:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex match till end of event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221279#M65048</link>
      <description>&lt;P&gt;Cool, this worked(Option 1), but its very odd that I had to resort to this, as the first example I tried had worked in many other situations!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 19:19:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-match-till-end-of-event/m-p/221279#M65048</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2016-08-10T19:19:03Z</dc:date>
    </item>
  </channel>
</rss>

