<?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: snmpget with splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50471#M9635</link>
    <description>&lt;P&gt;Not to be picky about the example provided, but shouldn't it be something like:&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
oid_value = re.match('^.&lt;EM&gt;Counter64:\s(?P&lt;NUMBER&gt;.&lt;/NUMBER&gt;&lt;/EM&gt;?)$', raw_oid_value)&lt;BR /&gt;
if oid_value:&lt;BR /&gt;
        print "snmp_key=" + oid_value.group(1)&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:57:28 GMT</pubDate>
    <dc:creator>oscarjoedaly</dc:creator>
    <dc:date>2020-09-28T11:57:28Z</dc:date>
    <item>
      <title>snmpget with splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50468#M9632</link>
      <description>&lt;P&gt;has anyone ever work with polling system information using snmpget and write it into files&lt;BR /&gt;
or using a scripted data input to poll them using snmpget?&lt;/P&gt;

&lt;P&gt;this is critical for my client who can only offer snmp as the only way to get data from the devices&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2012 06:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50468#M9632</guid>
      <dc:creator>cpuppet</dc:creator>
      <dc:date>2012-01-13T06:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: snmpget with splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50469#M9633</link>
      <description>&lt;P&gt;What you are asking is no different that any other scripted inputs. &lt;/P&gt;

&lt;P&gt;The only advice is to reformat the data from your snmpget command to something very suitable for Splunk (i.e. key=value).&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2012 10:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50469#M9633</guid>
      <dc:creator>RubenOlsen</dc:creator>
      <dc:date>2012-01-13T10:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: snmpget with splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50470#M9634</link>
      <description>&lt;P&gt;So, if you wanted to spin it into a key=value pair to make it nice and easy for Splunk, you could do something in Python like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import subprocess, re

snmp_proc = subprocess.Popen('snmpget -v &amp;lt;snmp version&amp;gt; -c &amp;lt;community string&amp;gt; &amp;lt;IP&amp;gt; &amp;lt;OID&amp;gt;', shell=True, stdout=subprocess.PIPE)
raw_oid_value = snmp_proc.stdout.read()
oid_value = re.match('^.*Counter64:\s(?P&amp;lt;number&amp;gt;.*?)$', raw_oid_value)
print "snmp_key=" + oid_value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or, you could just use something simple from a sh script and do all of the parsing in Splunk:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;snmpget -c &amp;lt;community string&amp;gt; -v &amp;lt;snmp version&amp;gt; &amp;lt;IP&amp;gt; &amp;lt;OID&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jan 2012 21:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50470#M9634</guid>
      <dc:creator>sbrant_tt</dc:creator>
      <dc:date>2012-01-13T21:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: snmpget with splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50471#M9635</link>
      <description>&lt;P&gt;Not to be picky about the example provided, but shouldn't it be something like:&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
oid_value = re.match('^.&lt;EM&gt;Counter64:\s(?P&lt;NUMBER&gt;.&lt;/NUMBER&gt;&lt;/EM&gt;?)$', raw_oid_value)&lt;BR /&gt;
if oid_value:&lt;BR /&gt;
        print "snmp_key=" + oid_value.group(1)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/snmpget-with-splunk/m-p/50471#M9635</guid>
      <dc:creator>oscarjoedaly</dc:creator>
      <dc:date>2020-09-28T11:57:28Z</dc:date>
    </item>
  </channel>
</rss>

