<?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 edit my props.conf and transforms.conf to extract field names and values from my events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281902#M85084</link>
    <description>&lt;P&gt;I tried the regex and it doesn't extract anything.  Also I read that the name of the group must start with an alpha value. &lt;/P&gt;

&lt;P&gt;I tried the following first regex inline and it worked. I tried the second one and Splunk displayed an error related with the alpha value issue. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "STEP:\s+\d+\n(?&amp;lt;myvalue&amp;gt;[\w\W\n]+?)\nSTEP" 
... | rex "STEP:\s+\d+\n(?&amp;lt;1myvalue&amp;gt;[\w\W\n]+?)\nSTEP" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Oct 2015 14:37:57 GMT</pubDate>
    <dc:creator>edrivera3</dc:creator>
    <dc:date>2015-10-22T14:37:57Z</dc:date>
    <item>
      <title>How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281898#M85080</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I want to extract the field names and field values of my events.&lt;BR /&gt;
My event looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Step:  1000
Result: blabkbk
Actual: blabblabl
Step:  1100
Result: blabkbk
Actual: blabblabl 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want the field name to be "1000" and "1100"and the respective field values to be everything below them. This is how I set up my props.conf and transforms.conf, but I am not extracting anything. I appreciate your help.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;mysourcetype&amp;gt;]
REPORT-step_num = step_num
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[step_num]
REGEX = STEP:\s+(?&amp;lt;_KEY_1&amp;gt;/d+)\n(?&amp;lt;_VAL_1&amp;gt;[\w\W\n]+?)\nSTEP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2015 20:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281898#M85080</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-10-16T20:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281899#M85081</link>
      <description>&lt;P&gt;Just a note: STEP does not equal Step.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 22:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281899#M85081</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-10-16T22:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281900#M85082</link>
      <description>&lt;P&gt;How have you configured you LINE-BREAKER? One suggestion is to set your LINE-BREAKER as follows&lt;/P&gt;

&lt;P&gt;SHOULD_LINEMERGE = True&lt;BR /&gt;
BREAK_ONLY_BEFORE = Step:&lt;/P&gt;

&lt;P&gt;Then you can define you AUTO-EXTRACT to be something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ([^\W]+):=\s+([^\W]+
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just a thought. Not sure I understand your questions. What do you expect your end result to look like? How have you set up your event line-breaking? From your example, would you like Step: 1000 Result: blabkbk Actual: blabbk to be one event and so on? &lt;/P&gt;

&lt;P&gt;If that's how you would like to see the events, then try adding the following to your props.conf&lt;/P&gt;

&lt;P&gt;SHOULD_LINEMERGE = True&lt;BR /&gt;
BREAK_ONLY_BEFORE = Step:&lt;/P&gt;

&lt;P&gt;And for field extraction (AUTO-EXTRACT) you could use something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ([^\W]+):=\s+([^\W]+) 
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above is just a general idea to get you started. Hopefully this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281900#M85082</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2020-09-29T07:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281901#M85083</link>
      <description>&lt;P&gt;Like this in &lt;CODE&gt;transforms.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX=(?ms)^Step:\s*([^\r\n]+)[\r\n]+(.*?)(?=\Z|[\r\n]+Step:)
CLEAN_KEYS = false
FORMAT = $1::$2
MV_ADD = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should be able to test it on directly in search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "(?ms)^Step:\s*(?&amp;lt;_KEY_1&amp;gt;[^\r\n]+)[\r\n]+(?&amp;lt;_VAL_1&amp;gt;.*?)(?=\Z|[\r\n]+Step:)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Oct 2015 22:12:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281901#M85083</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-17T22:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281902#M85084</link>
      <description>&lt;P&gt;I tried the regex and it doesn't extract anything.  Also I read that the name of the group must start with an alpha value. &lt;/P&gt;

&lt;P&gt;I tried the following first regex inline and it worked. I tried the second one and Splunk displayed an error related with the alpha value issue. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "STEP:\s+\d+\n(?&amp;lt;myvalue&amp;gt;[\w\W\n]+?)\nSTEP" 
... | rex "STEP:\s+\d+\n(?&amp;lt;1myvalue&amp;gt;[\w\W\n]+?)\nSTEP" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2015 14:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281902#M85084</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-10-22T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281903#M85085</link>
      <description>&lt;P&gt;The event cannot be divided because there are  relevant information at the beginning  of the event related to all the steps. If I divided the steps of the event, then the information in this step would not have any reference of what's about and they would be useless.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 14:42:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281903#M85085</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-10-22T14:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281904#M85086</link>
      <description>&lt;P&gt;The &lt;CODE&gt;_KEY_1&lt;/CODE&gt; and &lt;CODE&gt;_VAL_1&lt;/CODE&gt; are special (valid) exceptions:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/Data/Configureindex-timefieldextraction#Add_a_regex_stanza_for_the_new_field_to_transforms.conf"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/Data/Configureindex-timefieldextraction#Add_a_regex_stanza_for_the_new_field_to_transforms.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I was &lt;EM&gt;guessing&lt;/EM&gt; that it could be tested inline but perhaps it cannot.  In any case, the transforms.conf &lt;EM&gt;will&lt;/EM&gt; work.  The &lt;CODE&gt;(ms)&lt;/CODE&gt; part is critical.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281904#M85086</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-22T17:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281905#M85087</link>
      <description>&lt;P&gt;Yes, but I was talking about the  invalid field names which are "1000" and "1100" in my example.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 18:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281905#M85087</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-10-22T18:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf and transforms.conf to extract field names and values from my events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281906#M85088</link>
      <description>&lt;P&gt;Those names are valid for Search Time, provided that you tell splunk not to clean them.  To do that, be sure to set this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CLEAN_KEYS = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/6.3.0/Admin/Transformsconf"&gt;http://www.splunk.com/base/Documentation/6.3.0/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;NOTE: This attribute is only valid for search-time field extractions.&lt;/LI&gt;
&lt;LI&gt;Optional. Controls whether Splunk "cleans" the keys (field names) it
extracts at search time.
"Key cleaning" is the practice of replacing any non-alphanumeric
characters (characters other than those falling between the a-z, A-Z, or
0-9 ranges) in field names with underscores, as well as the stripping of
leading underscores and 0-9 characters from field names.&lt;/LI&gt;
&lt;LI&gt;Add CLEAN_KEYS = false to your transform if you need to extract field
names that include non-alphanumeric characters, or which begin with
underscores or 0-9 characters.&lt;/LI&gt;
&lt;LI&gt;Defaults to true.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 22 Oct 2015 18:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-and-transforms-conf-to-extract-field/m-p/281906#M85088</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-22T18:55:33Z</dc:date>
    </item>
  </channel>
</rss>

