<?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 Snmpwalk KV Field Extraction in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103559#M21786</link>
    <description>&lt;P&gt;Greetz,&lt;/P&gt;

&lt;P&gt;Man, do I feel stupid tonight, I can't even get this simple task working.&lt;BR /&gt;
Please can someone help me?&lt;/P&gt;

&lt;P&gt;I have like so from a snmpwalk scripted input:&lt;/P&gt;

&lt;P&gt;IF-MIB::ifOutNUcastPkts.1 = Counter32: 420714&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.2 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.3 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.4 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutDiscards.1 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutDiscards.2 = Counter32: 16&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;
[snmp]&lt;BR /&gt;
TRANSFORMS-snmpwalk = snmpwalk&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;BR /&gt;
[snmpwalk]&lt;BR /&gt;
REGEX = (?m)IF-MIB::(.&lt;EM&gt;?)\s=\s.&lt;/EM&gt;?:\s(.*)&lt;BR /&gt;
FORMAT = $1::$2&lt;/P&gt;

&lt;P&gt;I know the regex can be improved.&lt;/P&gt;

&lt;P&gt;What am I doing wrong here?&lt;BR /&gt;
I just want the KV fields extracted!&lt;BR /&gt;
I keep getting 'Counter32' for the field value.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2013 18:37:23 GMT</pubDate>
    <dc:creator>ephemeric</dc:creator>
    <dc:date>2013-01-29T18:37:23Z</dc:date>
    <item>
      <title>Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103559#M21786</link>
      <description>&lt;P&gt;Greetz,&lt;/P&gt;

&lt;P&gt;Man, do I feel stupid tonight, I can't even get this simple task working.&lt;BR /&gt;
Please can someone help me?&lt;/P&gt;

&lt;P&gt;I have like so from a snmpwalk scripted input:&lt;/P&gt;

&lt;P&gt;IF-MIB::ifOutNUcastPkts.1 = Counter32: 420714&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.2 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.3 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutNUcastPkts.4 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutDiscards.1 = Counter32: 0&lt;BR /&gt;
IF-MIB::ifOutDiscards.2 = Counter32: 16&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;
[snmp]&lt;BR /&gt;
TRANSFORMS-snmpwalk = snmpwalk&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;BR /&gt;
[snmpwalk]&lt;BR /&gt;
REGEX = (?m)IF-MIB::(.&lt;EM&gt;?)\s=\s.&lt;/EM&gt;?:\s(.*)&lt;BR /&gt;
FORMAT = $1::$2&lt;/P&gt;

&lt;P&gt;I know the regex can be improved.&lt;/P&gt;

&lt;P&gt;What am I doing wrong here?&lt;BR /&gt;
I just want the KV fields extracted!&lt;BR /&gt;
I keep getting 'Counter32' for the field value.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 18:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103559#M21786</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2013-01-29T18:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103560#M21787</link>
      <description>&lt;P&gt;Yes, you are getting the default key/value pairs because of the '='.  Try this regex in place of yours:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IF-MIB::(.+)\s=\s\w+:\s(\d+)$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103560#M21787</guid>
      <dc:creator>sbrant_splunk</dc:creator>
      <dc:date>2013-01-29T19:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103561#M21788</link>
      <description>&lt;P&gt;Although you have a field name of Counter32, are you also seeing field names with this format?  "ifOutDiscards.2"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 20:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103561#M21788</guid>
      <dc:creator>sbrant_splunk</dc:creator>
      <dc:date>2013-01-29T20:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103562#M21789</link>
      <description>&lt;P&gt;If you're not terribly worried about what the raw data looks like once it's within Splunk, you could easily use the interface table that SNMP provides. (You're really not worried about the raw data, right? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Splunk's "multikv" command easily breaks down the resulting SNMP table into searchable fields and values. And since you're SNMP walking, you might as well use snmptable since it's really just a more efficient way to walk.&lt;/P&gt;

&lt;P&gt;Here's my one-line scripted input (stored in a bash script):&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;snmptable -v2c -c public 192.168.10.1 if&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The resulting table is dropped directly into my Splunk index (every 10 minutes) and that's really all there is to it. From there I simply pipe my search to the multikv command and Splunk automatically discovers the key/value pairs and extracts them both for me:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=snmpwalk index=snmp | multikv&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 13:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103562#M21789</guid>
      <dc:creator>sspencer_splunk</dc:creator>
      <dc:date>2013-01-30T13:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103563#M21790</link>
      <description>&lt;P&gt;Sorry, I knew it was something simple, and the above regex was copy and paste broken:&lt;/P&gt;

&lt;P&gt;[snmp]&lt;BR /&gt;
KV_MODE = none&lt;BR /&gt;
REPORT-snmpwalk = snmpwalk&lt;/P&gt;

&lt;P&gt;[snmpwalk]&lt;BR /&gt;
REGEX = IF-MIB::(\w+\.\d+)\s=\s\w+:\s(.*?)$&lt;BR /&gt;
FORMAT = $1::$2&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
MV_ADD = 0&lt;BR /&gt;
disabled = 0&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103563#M21790</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2020-09-28T13:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103564#M21791</link>
      <description>&lt;P&gt;Wow! Thank you, I tried this and it works. But stupid me I see only one field for ifInOctets and ifOutOctets. How do I get the octets per interface?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 15:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103564#M21791</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2013-01-30T15:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103565#M21792</link>
      <description>&lt;P&gt;Actually, I didn't notice the problem until you mentioned it. Then, it was obvious. My first thoughts are to manually search based on the interface you're curious about. That can be done with the "ifIndex" field that multikv extracts automatically. Unfortunately, it seems that the "ifDescr" field isn't being extracted in my Splunk instance. That would really be a better field to use because it persists over time, while ifIndex can change. (SNMP interface index numbers change on occasion.)&lt;/P&gt;

&lt;P&gt;sourcetype=snmpwalk index=temp | multikv | search ifIndex="2"&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2013 00:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103565#M21792</guid>
      <dc:creator>sspencer_splunk</dc:creator>
      <dc:date>2013-01-31T00:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Snmpwalk KV Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103566#M21793</link>
      <description>&lt;P&gt;I noticed that not all events were being extracted too... but thank you for giving me ideas, a different angle.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2013 10:19:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Snmpwalk-KV-Field-Extraction/m-p/103566#M21793</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2013-01-31T10:19:14Z</dc:date>
    </item>
  </channel>
</rss>

