<?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: Help with field extraction regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495246#M138085</link>
    <description>&lt;P&gt;@dmarling  Thanks, I got it.&lt;/P&gt;

&lt;P&gt;This one worked&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2019 14:37:19 GMT</pubDate>
    <dc:creator>snallam123</dc:creator>
    <dc:date>2019-10-11T14:37:19Z</dc:date>
    <item>
      <title>Help with field extraction regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495242#M138081</link>
      <description>&lt;P&gt;&lt;STRONG&gt;- com.texh.servers.policy.assertion.ServerAuditDetailAssertion:&lt;BR /&gt;
  com.texh.log.custom.Applications:&lt;BR /&gt;
  com.texh.log.custom.paymentRedirects:&lt;BR /&gt;
  com.texh.log.custom.Permission:&lt;BR /&gt;
  com.texh.logs.system.Application:&lt;BR /&gt;
  com.texh.logs.policy.assertion:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "^(?:[^ \n]* ){6}(?P[^ ]+)" and "^(.\w*?):"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried above but it's not correct.&lt;/P&gt;

&lt;P&gt;I need to extract these: ServerAuditDetailAssertion, Applications paymentRedirects  Permission  Application assertion to any new field. &lt;/P&gt;

&lt;P&gt;Can someone help me with this?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 20:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495242#M138081</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2019-10-10T20:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field extraction regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495243#M138082</link>
      <description>&lt;P&gt;Can you please clarify exactly what output you want?  I've read your question, but I'm not sure what you are trying to do.  Are there values after the colon?  Are you looking for one field or multiple?&lt;/P&gt;

&lt;P&gt;Could you maybe list the exact log message (anonymity, but have representative data in its place) with a table of field and expect value.  There are many regex gurus here, but to me at least its not clear what you are requesting.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 20:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495243#M138082</guid>
      <dc:creator>triest</dc:creator>
      <dc:date>2019-10-10T20:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field extraction regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495244#M138083</link>
      <description>&lt;P&gt;This regex will accomplish that.  Here's a run anywhere example as well to demonstrate it: &lt;CODE&gt;| rex field=_raw max_match=0 "com\..*\.(?&amp;lt;field&amp;gt;[^\:]+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval _raw="com.texh.servers.policy.assertion.ServerAuditDetailAssertion:
com.texh.log.custom.Applications:
com.texh.log.custom.paymentRedirects:
com.texh.log.custom.Permission:
com.texh.logs.system.Application:
com.texh.logs.policy.assertion"
| rex field=_raw max_match=0 "com\..*\.(?&amp;lt;field&amp;gt;[^\:]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7768i5A89C4D50ACD9D15/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 20:58:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495244#M138083</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2019-10-10T20:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field extraction regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495245#M138084</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/221061"&gt;@triest&lt;/a&gt; ,  I just need the regex one. I am looking for extracting a field starting with "com." and last word before ":" &lt;/P&gt;

&lt;P&gt;"com.&lt;EM&gt;.&lt;/EM&gt;.&lt;EM&gt;.&lt;/EM&gt;.assertion:" I just want to do stats of field extracted from a word before colon.&lt;/P&gt;

&lt;P&gt;eg:&lt;BR /&gt;&lt;BR /&gt;
My events: (are not indexed correctly) &lt;BR /&gt;
 com.texh.logs.policy.assertion: 0880&lt;BR /&gt;
com.texh.log.custom.exemptions:&lt;BR /&gt;
 com.texh.log.custom.payment: 8800:&lt;BR /&gt;
 com.texh.log.call.Permission: ABCD: dshhvnk dndsvndskjvdscn: jdcnvfdkjvnfdkv:&lt;BR /&gt;
 com.texh.logs.system.Application: 8877:&lt;/P&gt;

&lt;P&gt;If i do | rex field=_raw max_match=0 ".(?[^.]+):\s+\d+:" | stats count by foo  it is not extracting all fields &lt;/P&gt;

&lt;P&gt;My results should be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;foo                              count
assertion                    10
excemptions                 20
Payment                        30
Permission                    40
Application                    50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To my understanding &lt;/P&gt;

&lt;P&gt;index=test sourcetype=test&lt;BR /&gt;
| rex field=_raw " .com.texh.log.custom.exemptions:"  (&lt;CODE&gt;rexfield extracting com.texh.log.custom.exemptions:&lt;/CODE&gt;)&lt;BR /&gt;
| rex field=foo "(?&lt;CODE&gt;regex for extracting a word before :&lt;/CODE&gt;)"&lt;BR /&gt;
| stats count by bar&lt;/P&gt;

&lt;P&gt;Thanks for response...&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495245#M138084</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2020-09-30T02:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field extraction regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495246#M138085</link>
      <description>&lt;P&gt;@dmarling  Thanks, I got it.&lt;/P&gt;

&lt;P&gt;This one worked&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 14:37:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-field-extraction-regex/m-p/495246#M138085</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2019-10-11T14:37:19Z</dc:date>
    </item>
  </channel>
</rss>

