<?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 generate a regular expression that extracts a field in my event data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317914#M95118</link>
    <description>&lt;P&gt;Hi, sorry if I misunderstood.&lt;/P&gt;

&lt;P&gt;Is that a multiline event?  If so, you should use this one: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*?\)\s+(?P&amp;lt;description&amp;gt;.*?)\n
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2017 19:51:30 GMT</pubDate>
    <dc:creator>jrballesteros05</dc:creator>
    <dc:date>2017-02-24T19:51:30Z</dc:date>
    <item>
      <title>How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317908#M95112</link>
      <description>&lt;P&gt;I need to do a field extraction for everything after the ) to the end of the first line. I've tried about every regex I can think of to signify EOL but nothing seems to work so far.&lt;/P&gt;

&lt;P&gt;Here is an event sample:&lt;BR /&gt;
2017-02-22T18:01:04             | Creating request for &lt;A href="https://0.0.0.0/images/logo.gif"&gt;https://0.0.0.0/images/logo.gif&lt;/A&gt; (msecure.company.com) Mobile US Site1 VIP&lt;BR /&gt;
2017-02-22T18:01:04             | Information SSL1399 - The certificate is valid.; Data: Mobile US Site1 VIP; URL: &lt;A href="https://0.0.0.0/images/logo.gif"&gt;https://0.0.0.0/images/logo.gif&lt;/A&gt;; Domain: msecure.company.com; Expiration: 08/10/2018 08:00:00&lt;/P&gt;

&lt;P&gt;So for this event I would want this field to be "Mobile US Site1 VIP".&lt;/P&gt;

&lt;P&gt;I'm sure I'm messing something up. Thanks in advanced!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:39:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317908#M95112</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2017-02-24T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317909#M95113</link>
      <description>&lt;P&gt;Is this what you are trying to do?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:^)(?:[^\)]+\)\s)(.+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 18:03:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317909#M95113</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-02-24T18:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317910#M95114</link>
      <description>&lt;P&gt;Your regex doesn't appear to select anything when I try it. &lt;/P&gt;

&lt;P&gt;Here is the regex that Splunk gives me when I try and do it through the wizard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^[^\)\n]*\)\s+(?P&amp;lt;description&amp;gt;\w+\s+\w+\s+\w+\s+\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will select anything up to a special character but the final field could have a dash ("-") in it and I can't control how long it is either.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 18:14:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317910#M95114</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2017-02-24T18:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317911#M95115</link>
      <description>&lt;P&gt;This seems to work at: &lt;A href="https://www.regex101.com/"&gt;https://www.regex101.com/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;^.[^)]+)\s+(?P.+)&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 18:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317911#M95115</guid>
      <dc:creator>pkeller</dc:creator>
      <dc:date>2017-02-24T18:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317912#M95116</link>
      <description>&lt;P&gt;This one seems to work for me: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; .*?\)\s+(?P&amp;lt;description&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317912#M95116</guid>
      <dc:creator>jrballesteros05</dc:creator>
      <dc:date>2017-02-24T19:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317913#M95117</link>
      <description>&lt;P&gt;Yeah. That's what I came up with when using an external site like &lt;A href="https://www.regex101.com/"&gt;https://www.regex101.com/&lt;/A&gt;. Unfortunately, when I try that in Splunk it begins at the correct spot but goes all the way to the end of the last line instead of stopping at the end of line 1. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://ibb.co/bBYXRF"&gt;&lt;IMG src="https://preview.ibb.co/cM0CRF/2017_02_24_14_39_09_Online_regex_tester_and_debugger_PHP_PCRE_Python_Golang_and_Java_Script.png" alt="2017 02 24 14 39 09 Online regex tester and debugger PHP PCRE Python Golang and Java Script" /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317913#M95117</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2017-02-24T19:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317914#M95118</link>
      <description>&lt;P&gt;Hi, sorry if I misunderstood.&lt;/P&gt;

&lt;P&gt;Is that a multiline event?  If so, you should use this one: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*?\)\s+(?P&amp;lt;description&amp;gt;.*?)\n
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:51:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317914#M95118</guid>
      <dc:creator>jrballesteros05</dc:creator>
      <dc:date>2017-02-24T19:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317915#M95119</link>
      <description>&lt;P&gt;So your example is a multi-line event? .... This might work: ^.[^)]+)\s+(?P.+)\n?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317915#M95119</guid>
      <dc:creator>pkeller</dc:creator>
      <dc:date>2017-02-24T19:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317916#M95120</link>
      <description>&lt;P&gt;YES! That did it. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317916#M95120</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2017-02-24T19:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a regular expression that extracts a field in my event data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317917#M95121</link>
      <description>&lt;P&gt;@Jeck11, glad @jrballesteros05's answer provided a working solution to your question? Please don't forget to resolve this post by clicking "Accept".&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 21:09:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-regular-expression-that-extracts-a-field-in-my/m-p/317917#M95121</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-24T21:09:28Z</dc:date>
    </item>
  </channel>
</rss>

