<?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 extract fields using regex in transforms.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-using-regex-in-transforms-conf/m-p/407789#M117767</link>
    <description>&lt;P&gt;Hello, I modified your regex a little to make it take less steps to find a match (you can see results &lt;A href="https://regex101.com/r/wyLhw8/1"&gt;here&lt;/A&gt;). Give this combination a try:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
REPORT-extraction_name = transform_stanza_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[transform_stanza_name]
REGEX = MIB\:\:(.+)\.\d\s\=\sSTRING\:\s(.+)
FORMAT = $1::$2
MV_ADD = true ## Use this if you have multiple values for same field name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Deploy these configurations to your search head(s) and search for data in smart mode or verbose mode. HTH!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2018 12:56:21 GMT</pubDate>
    <dc:creator>sudosplunk</dc:creator>
    <dc:date>2018-08-14T12:56:21Z</dc:date>
    <item>
      <title>How to extract fields using regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-using-regex-in-transforms-conf/m-p/407788#M117766</link>
      <description>&lt;P&gt;Hello everybody&lt;/P&gt;

&lt;P&gt;I am new to the regex topic.&lt;/P&gt;

&lt;P&gt;I have events with folowing information:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SPIEE-WIRELESS-MIB::**bsnStationMacAddress**.0 = STRING: **a9:12:fa:13:19:8F**
CISCO-LWAPP-UMBH-CALLT-MIB::**cldcClientSSID**.0 = STRING: **Campus-WLAN**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As we can see, we can present these two (and further logs) in following format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blabla-MIB::**FIELDNAME**.0 = Blabla: **FIELDVALUE**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I &lt;STRONG&gt;have to&lt;/STRONG&gt; apply this extraction in transforms.conf&lt;BR /&gt;
My idea is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mytransform]
REGEX= (?:.*\-MIB::)(.+)(?:\.0\s\=\s[a-zA-Z0-9]+:\s)(.+)
FORMAT= $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both (.+) are the field names and field values. I have extracted them as groups but how do I define them as a  Splunk fieldname and field value?&lt;/P&gt;

&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 11:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-using-regex-in-transforms-conf/m-p/407788#M117766</guid>
      <dc:creator>alex_kh</dc:creator>
      <dc:date>2018-08-14T11:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields using regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-using-regex-in-transforms-conf/m-p/407789#M117767</link>
      <description>&lt;P&gt;Hello, I modified your regex a little to make it take less steps to find a match (you can see results &lt;A href="https://regex101.com/r/wyLhw8/1"&gt;here&lt;/A&gt;). Give this combination a try:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
REPORT-extraction_name = transform_stanza_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[transform_stanza_name]
REGEX = MIB\:\:(.+)\.\d\s\=\sSTRING\:\s(.+)
FORMAT = $1::$2
MV_ADD = true ## Use this if you have multiple values for same field name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Deploy these configurations to your search head(s) and search for data in smart mode or verbose mode. HTH!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-fields-using-regex-in-transforms-conf/m-p/407789#M117767</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-14T12:56:21Z</dc:date>
    </item>
  </channel>
</rss>

