<?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: Need Regex to extract the fields in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590554#M11901</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; hi i need your help for a regex to get the fields&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 02:24:19 GMT</pubDate>
    <dc:creator>pchintha</dc:creator>
    <dc:date>2022-03-24T02:24:19Z</dc:date>
    <item>
      <title>How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590553#M11900</link>
      <description>&lt;P&gt;&lt;STRONG&gt;From the below Log:&lt;BR /&gt;&lt;/STRONG&gt;aoauwersdfx01a-mgt.example.com NewDecom: Info: 164807335647.901 0 10.200.111.06 NONE/504 0 GET &lt;A href="http://wpad.example.com/wpad.dat" target="_blank" rel="noopener"&gt;http://wpad.example.com/wpad.dat&lt;/A&gt; - NONE/wpad.example.com&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Need to extract the fields:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Field 1:&lt;/STRONG&gt;&amp;nbsp;result=NON/504 &lt;STRONG&gt;change to&lt;/STRONG&gt; status=504&lt;BR /&gt;&lt;STRONG&gt;Field 2:&lt;/STRONG&gt; url=&lt;A href="http://wpad.example.com/wpad.dat" target="_blank" rel="noopener"&gt;http://wpad.example.com/wpad.dat&lt;/A&gt; &lt;STRONG&gt;change to&lt;/STRONG&gt; url=wpad.example.com&lt;/P&gt;
&lt;P&gt;Need the regular expression for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 04:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590553#M11900</guid>
      <dc:creator>pchintha</dc:creator>
      <dc:date>2022-03-24T04:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need Regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590554#M11901</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; hi i need your help for a regex to get the fields&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 02:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590554#M11901</guid>
      <dc:creator>pchintha</dc:creator>
      <dc:date>2022-03-24T02:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590569#M11903</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=result "/(?&amp;lt;status&amp;gt;\d+)"
| rex field=url "http://(?&amp;lt;url&amp;gt;[^/ ]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Mar 2022 06:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590569#M11903</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-24T06:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590619#M11904</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; i checked but its not matching anything and also after this work i need to add in props.conf this regex so based on this please share the regex this is not working at all for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pchintha_0-1648110742319.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18738iAE319EA8E7FDEFD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pchintha_0-1648110742319.png" alt="pchintha_0-1648110742319.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pchintha_1-1648110773548.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18739iB3DF5749552F848D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pchintha_1-1648110773548.png" alt="pchintha_1-1648110773548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 08:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590619#M11904</guid>
      <dc:creator>pchintha</dc:creator>
      <dc:date>2022-03-24T08:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590626#M11905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240313"&gt;@pchintha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;quick question before the regex&lt;/P&gt;&lt;P&gt;is the status code always prefixed with NONE&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also for the url at the end of the log is it always prefixed with &lt;SPAN&gt;NONE/wpad.example.com&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if yes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NONE\/(?&amp;lt;url&amp;gt;[a-z.]+)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_0-1648114825894.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18741iE1155D8E6CA5CF05/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_0-1648114825894.png" alt="venky1544_0-1648114825894.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NONE\/(?&amp;lt;status&amp;gt;\d+)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_1-1648114856180.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18742iF64E3471374AF556/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_1-1648114856180.png" alt="venky1544_1-1648114856180.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;above are individual regex and below is one single regex if NONE is always preceded before URL and status&lt;/P&gt;&lt;P&gt;NONE\/(?&amp;lt;status&amp;gt;\d+)([\w+ :\/\/.-]+)NONE\/(?&amp;lt;url&amp;gt;[[a-z.]+)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_2-1648115085600.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18743iCF9D02F3C4B128E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_2-1648115085600.png" alt="venky1544_2-1648115085600.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you find the answer helpful please accept the solution also karma is appreciated&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 09:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590626#M11905</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-24T09:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590634#M11907</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/137142"&gt;@venky1544&lt;/a&gt;&amp;nbsp;thanks for your help, but i need only the output is&amp;nbsp;&lt;/P&gt;&lt;P&gt;status=504 not to be like status=/504&lt;/P&gt;&lt;P&gt;url=wpad.example.com not to be like url=&lt;A href="http://wpad.example.com" target="_blank"&gt;http://wpad.example.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here we are separating the http:// only we are not checking the NONE things in the url field&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 10:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590634#M11907</guid>
      <dc:creator>pchintha</dc:creator>
      <dc:date>2022-03-24T10:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need Regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590649#M11910</link>
      <description>&lt;P&gt;any luck from anyone.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 11:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590649#M11910</guid>
      <dc:creator>pchintha</dc:creator>
      <dc:date>2022-03-24T11:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590651#M11911</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240313"&gt;@pchintha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you mean by /504 and&amp;nbsp;url=&lt;A href="http://wpad.example.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://wpad.example.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;clearly the regex is extracting 504 and not /504 and&amp;nbsp;&lt;A href="http://wpad.example.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;wpad.example.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please check the screenshot there is nothing wrong with the reg ex&lt;/P&gt;&lt;P&gt;it seems you are doing something in correct in splunk while implementing the regex&amp;nbsp;&lt;/P&gt;&lt;P&gt;please share your complete splunk query how you are executing it&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_0-1648123125051.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18748iE2004582F2343418/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_0-1648123125051.png" alt="venky1544_0-1648123125051.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 12:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590651#M11911</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-24T12:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create regex to extract the fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590661#M11912</link>
      <description>&lt;P&gt;there errors you are getting there its because in regex101&amp;nbsp;you need to escape the "/" like "\/"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-24 at 12.52.50.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18749i9767DC6E303BC292/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-03-24 at 12.52.50.png" alt="Screenshot 2022-03-24 at 12.52.50.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-24 at 12.54.11.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18750i4A4E6179E6B39D97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-03-24 at 12.54.11.png" alt="Screenshot 2022-03-24 at 12.54.11.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 12:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-create-regex-to-extract-the-fields/m-p/590661#M11912</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2022-03-24T12:54:58Z</dc:date>
    </item>
  </channel>
</rss>

