<?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: Extracting fields from SNMP GETBULK data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212219#M62097</link>
    <description>&lt;P&gt;Great, let us know how it works out.  As is often the case, there are more than a few ways to "skin the cat".&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jan 2016 13:13:51 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-01-04T13:13:51Z</dc:date>
    <item>
      <title>Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212213#M62091</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I need to extract fields from data continuously polled for via SNMP Modular Input. Each event looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IF-MIB::ifInOctets."1" = "1587826952" IF-MIB::ifOutOctets."1" = "3472375195" IF-MIB::ifInOctets."2" = "0" IF-MIB::ifOutOctets."2" = "0" IF-MIB::ifInOctets."3" = "0" IF-MIB::ifOutOctets."3" = "0" IF-MIB::ifInOctets."4" = "0" IF-MIB::ifOutOctets."4" = "0" IF-MIB::ifInOctets."5" = "0" IF-MIB::ifOutOctets."5" = "0" IF-MIB::ifInOctets."6" = "50036733" IF-MIB::ifOutOctets."6" = "3575426650" IF-MIB::ifInOctets."7" = "0" IF-MIB::ifOutOctets."7" = "0" IF-MIB::ifInOctets."8" = "657176060" IF-MIB::ifOutOctets."8" = "2715199686"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried using the extractions in snmp_ta but it didn't work for this particular set of SNMP poll data. It managed to create "&lt;EM&gt;ifInOctets&lt;/EM&gt;" and "&lt;EM&gt;ifOutOctets&lt;/EM&gt;" fields but does not separate them by interface ID.&lt;/P&gt;

&lt;P&gt;I've then resorted to index-time extraction. &lt;/P&gt;

&lt;P&gt;My &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snmp_ifOctets_extraction]
REGEX=IF-MIB::(.+?)\.\"((?:\d\.?)+)\"\s=\s\"(.*?)\"
FORMAT=$1.$2::$3
WRITE_META = true
REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My &lt;STRONG&gt;props.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snmp_ifoctets]
TRANSFORMS-ifoctets = snmp_ifOctets_extraction
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That didn't turn out so well either. It extracted just one field, "&lt;EM&gt;ifInOctets.1&lt;/EM&gt;". The regex didn't seem to repeat itself throughout the event even though REPEAT_MATCH is set. Anyone have any ideas why this is happening?&lt;/P&gt;

&lt;P&gt;PS I'm also open to any other ideas on how to parse this set of data. I'm thinking of splitting each poll result into individual events next if index-time extraction isn't workable.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 09:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212213#M62091</guid>
      <dc:creator>adlireza</dc:creator>
      <dc:date>2015-12-31T09:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212214#M62092</link>
      <description>&lt;P&gt;Try adding this to the beginning of your regex your regex &lt;CODE&gt;(?s)&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [snmp_ifOctets_extraction]
 REGEX=(?s)IF-MIB::(.+?)\.\"((?:\d\.?)+)\"\s=\s\"(.*?)\"
 FORMAT=$1.$2::$3
 WRITE_META = true
 REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(?s) = dotall&lt;BR /&gt;
(?m) = multiline&lt;BR /&gt;
(?ms) = dotall, multiline&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2016 13:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212214#M62092</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-01T13:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212215#M62093</link>
      <description>&lt;P&gt;This doesn't work for me. It still only extracts one field. &lt;/P&gt;

&lt;P&gt;I think the regex part should be OK. I've tested it against a sample of the results using RegExr and it is able to capture multiple groups there. I'm thinking it's something more to do with Splunk, maybe some setting in either transforms, props or fields.conf.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 06:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212215#M62093</guid>
      <dc:creator>adlireza</dc:creator>
      <dc:date>2016-01-02T06:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212216#M62094</link>
      <description>&lt;P&gt;Ok so is it worth it to break each of these fields into their own events using a line breaker regex?&lt;/P&gt;

&lt;P&gt;I feel like the (?ms) might also work but maybe not since there's this repaet_match setting.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 13:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212216#M62094</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-02T13:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212217#M62095</link>
      <description>&lt;P&gt;And don't forget to disable should_linemerge if you go that route.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 14:00:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212217#M62095</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-02T14:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212218#M62096</link>
      <description>&lt;P&gt;Thanks. That will be my next course of action. I will be using the built-in option in the SNMP Modular Input app to split the output into individual lines.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 03:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212218#M62096</guid>
      <dc:creator>adlireza</dc:creator>
      <dc:date>2016-01-04T03:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212219#M62097</link>
      <description>&lt;P&gt;Great, let us know how it works out.  As is often the case, there are more than a few ways to "skin the cat".&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 13:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212219#M62097</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-04T13:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from SNMP GETBULK data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212220#M62098</link>
      <description>&lt;P&gt;Hello @adlireza &lt;/P&gt;

&lt;P&gt;Hope you can update us with your working solution at the end.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 00:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-fields-from-SNMP-GETBULK-data/m-p/212220#M62098</guid>
      <dc:creator>Muwafi</dc:creator>
      <dc:date>2019-04-12T00:29:02Z</dc:date>
    </item>
  </channel>
</rss>

