<?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 How to write regex to extract my field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182016#M52475</link>
    <description>&lt;P&gt;Hi, i'm try using the interactive field extractor tools create a field for this&lt;/P&gt;

&lt;P&gt;"Exception Message"="Thread was being aborted."&lt;/P&gt;

&lt;P&gt;but getting following error "The generated regex was unable to match all examples (e.g., =, Thread was being aborted., Exception Message). Consider entering different examples, or manually editing the regex."&lt;/P&gt;

&lt;P&gt;any suggestion a regex syntax or how to auto detect the field it?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Oct 2014 20:39:26 GMT</pubDate>
    <dc:creator>tlow</dc:creator>
    <dc:date>2014-10-23T20:39:26Z</dc:date>
    <item>
      <title>How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182016#M52475</link>
      <description>&lt;P&gt;Hi, i'm try using the interactive field extractor tools create a field for this&lt;/P&gt;

&lt;P&gt;"Exception Message"="Thread was being aborted."&lt;/P&gt;

&lt;P&gt;but getting following error "The generated regex was unable to match all examples (e.g., =, Thread was being aborted., Exception Message). Consider entering different examples, or manually editing the regex."&lt;/P&gt;

&lt;P&gt;any suggestion a regex syntax or how to auto detect the field it?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182016#M52475</guid>
      <dc:creator>tlow</dc:creator>
      <dc:date>2014-10-23T20:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182017#M52476</link>
      <description>&lt;P&gt;Can you post some complete sample events, along with the what string to extract?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182017#M52476</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-23T20:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182018#M52477</link>
      <description>&lt;P&gt;"Exception Message"="Thread was being aborted.", Source=OAA.Security.PassiveSTS.Shell, TargetSite="Void SignOutRequest()", WindowsIdentity="IIS APPPOOL\Test.com"&lt;/P&gt;

&lt;P&gt;Above is the logs, but splunk auto assign the field to "Source" ,"TargetSite" and "WindowsIdentity" but not "Exception Message" or maybe the "&lt;/P&gt;

&lt;P&gt;i want extract  exception message "Exception Message"="*" or better to have it in props.conf to auto assign it.&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182018#M52477</guid>
      <dc:creator>tlow</dc:creator>
      <dc:date>2014-10-23T20:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182019#M52478</link>
      <description>&lt;P&gt;For Search time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=_raw "\"Exception Message\"=\"(?&amp;lt;ExceptionMessage&amp;gt;[^\"]*)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In Props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-exceptionmsg = \"Exception Message\"=\"(?&amp;lt;ExceptionMessage&amp;gt;[^\"]*)\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Oct 2014 21:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182019#M52478</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-23T21:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182020#M52479</link>
      <description>&lt;P&gt;works great, but how to setup it up so that splunk automatic recognize fields based on &lt;/P&gt;

&lt;P&gt;"Exception Message"="*"&lt;/P&gt;

&lt;P&gt;for example splunk recognize this Source=OAA.Security.PassiveSTS.Shell automatic  assigning "Source" as the field,&lt;BR /&gt;
thank-you for your help&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 22:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182020#M52479</guid>
      <dc:creator>tlow</dc:creator>
      <dc:date>2014-10-23T22:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract my field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182021#M52480</link>
      <description>&lt;P&gt;If you're asking about extracting the field name along with the field value, you can do that with a combination of props.conf and transforms.conf:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
REPORT-kv = extract_quoted_fields
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_quoted_fields]
REGEX = "(?&amp;lt;_KEY_1&amp;gt;([^"]|\\")+)"\s*=\s*"(?&amp;lt;_VAL_1&amp;gt;([^"]|\\")+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Make sure my Q'n'D regex actually suits your data, didn't test it myself. The main thing is to use the magic &lt;CODE&gt;_KEY_x&lt;/CODE&gt; and &lt;CODE&gt;_VAL_x&lt;/CODE&gt; names to extract both field names and field values in one swoop.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 22:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-my-field/m-p/182021#M52480</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-23T22:48:51Z</dc:date>
    </item>
  </channel>
</rss>

