<?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: Field Extraction from event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157084#M31840</link>
    <description>&lt;P&gt;You may also want to take a look at delimiter-based field extractions: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Configuring_delimiter-based_field_extraction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Configuring_delimiter-based_field_extraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the config details, see the DELIMS and FIELDS keys in transforms.conf: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Your config is going to look something like this:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
REPORT-pipedfields = pipedfields
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[pipedfields]
DELIMS = "|"
FIELDS = field1, field2, ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Feb 2014 15:09:29 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-02-19T15:09:29Z</dc:date>
    <item>
      <title>Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157079#M31835</link>
      <description>&lt;P&gt;I have this Event : (A|0000349541000123126400200|A2C12312091142|A2C58063752|||01|004730343236303305002A0043|53427677011118600001|1|v1_09_111020||1202|02010||04|A2C53425053|CCR1130601630003|01 H02010 S1202 CXXX|11.11.02|28512312721R ---|0|0||||||)(B|2|tmarep1s|8|A2C58063751_BOT|Renlt_1.011:v3.06|110926171939||102|||T2801-8 limit error:|Classification Station|||||||||)(||||||+0.1824000E+01|+0.1093000E+03|||||||)&lt;/P&gt;

&lt;P&gt;how do I split this on "|" in separate fields so that I may search in multiple events like this one? I can\t find solutions i'm new to splunk it's first time I worked with this program I I don't know to much. please tell me how to create a regex that I can apply to multiple events &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157079#M31835</guid>
      <dc:creator>CsinadyIoan</dc:creator>
      <dc:date>2020-09-28T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157080#M31836</link>
      <description>&lt;P&gt;I believe something like this should work   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | eval first_group = mvindex(split(_raw,"|"),0) | eval second_group = mvindex(split(_raw,"|"),1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Feb 2014 14:01:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157080#M31836</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2014-02-19T14:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157081#M31837</link>
      <description>&lt;P&gt;could you please be more explicit on this:) as I told you i'm new... and splunk commands are still a mistery for me. I just tried adding this on search and nothing happened.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2014 14:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157081#M31837</guid>
      <dc:creator>CsinadyIoan</dc:creator>
      <dc:date>2014-02-19T14:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157082#M31838</link>
      <description>&lt;P&gt;In my example, I am using mvindex/split to create a new field called first_group and second_group based on the position of &lt;CODE&gt;|&lt;/CODE&gt; in the raw data. You can then use those new fields in your search. For example, a search may look like&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;source="my_log.txt" &lt;BR /&gt;
| eval first_group = mvindex(split(_raw,"|"),0) &lt;BR /&gt;
| eval second_group = mvindex(split(_raw,"|"),1)&lt;BR /&gt;
| stats c by first_group second_group&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;which would count the number of events grouped by the first and second group. I'm not exactly sure what you want to accomplish, but hopefully this gives you some idea how to use the search.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:55:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157082#M31838</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2020-09-28T15:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157083#M31839</link>
      <description>&lt;P&gt;Another option: If you know what all different fields are present in your logs (separated by "|"), you can use below to get them as fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype=yoursourcetype source=yoursource | rex "(?i).*?(?P&amp;lt;field1&amp;gt;\w+)" | rex "(?i)^(?:[^\|]*\|){1}(?P&amp;lt;field2&amp;gt;[^\|]+)" | rex "(?i)^(?:[^\|]*\|){2}(?P&amp;lt;field3&amp;gt;[^\|]+)"...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For other fields (based on the order in which they appear in your event), your can change the integer value in "{}" and update field name.&lt;BR /&gt;
e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field 2 ("0000349541000123126400200" and "2" in your example) 
| rex "(?i)^(?:[^\|]*\|){1}(?P&amp;lt;field2&amp;gt;[^\|]+)"

field 3 ("A2C12312091142" and "tmarep1s" in your example) 
| rex "(?i)^(?:[^\|]*\|){1}(?P&amp;lt;field3&amp;gt;[^\|]+)"

and so on
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Feb 2014 15:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157083#M31839</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-19T15:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157084#M31840</link>
      <description>&lt;P&gt;You may also want to take a look at delimiter-based field extractions: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Configuring_delimiter-based_field_extraction"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles#Configuring_delimiter-based_field_extraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the config details, see the DELIMS and FIELDS keys in transforms.conf: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Your config is going to look something like this:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
REPORT-pipedfields = pipedfields
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[pipedfields]
DELIMS = "|"
FIELDS = field1, field2, ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Feb 2014 15:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction-from-event/m-p/157084#M31840</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-19T15:09:29Z</dc:date>
    </item>
  </channel>
</rss>

