<?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: Help with regex to parse the snmp inputs? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491971#M84095</link>
    <description>&lt;P&gt;&lt;CODE&gt;mvexpand&lt;/CODE&gt; gives you a different event for each value in a multi-value field.  Using &lt;CODE&gt;mvindex&lt;/CODE&gt; keeps all of the fields associated with the same event.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 12:57:52 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-10-02T12:57:52Z</dc:date>
    <item>
      <title>Help with regex to parse the snmp inputs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491968#M84092</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Can someone help me to parse the fields either at indexing or through searches?  Splunk detects the default fields as enterprises.48099.1.1.1/enterprises.48099.1.1.2 etc., . but we only need the value inside the quotations like below.&lt;/P&gt;

&lt;P&gt;enterprises.48099.1.1.2 = STRING: "Monitoring error (SQL Server data collection)". But we need field as below:&lt;/P&gt;

&lt;P&gt;field1 = Monitoring error (SQL Server data collection)  &lt;/P&gt;

&lt;P&gt;Sample Data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-10-01 21:05:24 monspk-sqlmon-01.local [UDP: [111.12.171.01]:64274-&amp;gt;[111.12.171.55]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.48099.1.1  SNMPv2-SMI::enterprises.48099.1.1.1 = STRING: "2360689" SNMPv2-SMI::enterprises.48099.1.1.2 = STRING: "Monitoring error (SQL Server data collection)"   SNMPv2-SMI::enterprises.48099.1.1.3 = STRING: "SQL Monitor cannot collect data from the SQL Server instance."   SNMPv2-SMI::enterprises.48099.1.1.4 = STRING: "2019-10-01 19:05:00Z"    SNMPv2-SMI::enterprises.48099.1.1.5 = STRING: "Low" SNMPv2-SMI::enterprises.48099.1.1.6 = STRING: "monspk-sql8-bi01"    SNMPv2-SMI::enterprises.48099.1.1.7 = STRING: "https://monspk-sqlmon-01.local:8443/show/alert/2360689?baseMonitorId=288e5411-856f-4661-97c1-3c6cc8b5d16c"   SNMPv2-SMI::enterprises.48099.1.1.8 = STRING: "Raised"  SNMPv2-SMI::enterprises.48099.1.1.9 = ""    SNMPv2-SMI::enterprises.48099.1.1.10 = ""   SNMPv2-SMI::enterprises.48099.1.1.11 = STRING: "monspk-sql8-clust.local"    SNMPv2-SMI::enterprises.48099.1.1.12 = STRING: "monspk-SQL8-CLUST - SQL Alert"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone please help with this to parse at indexing or through rex.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491968#M84092</guid>
      <dc:creator>mallempati</dc:creator>
      <dc:date>2019-10-01T19:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex to parse the snmp inputs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491969#M84093</link>
      <description>&lt;P&gt;Here's one way.  Since all of the strings you want to extract have no unique identifier, this &lt;CODE&gt;rex&lt;/CODE&gt; command will pull them all into a multivalue field called 'fields'.  Then you can use &lt;CODE&gt;mvindex&lt;/CODE&gt; to access the individual fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "STRING:\s\"(?&amp;lt;fields&amp;gt;[^\"]+)" | eval field1=mvindex(fields,0), field2=mvindex(fields, 1) ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Oct 2019 20:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491969#M84093</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-01T20:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex to parse the snmp inputs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491970#M84094</link>
      <description>&lt;P&gt;Hi @richgalloway,&lt;/P&gt;

&lt;P&gt;Is there a specific reason you wouldn't use &lt;CODE&gt;mvexpand&lt;/CODE&gt;? Just curious.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Jacob&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 20:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491970#M84094</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-10-01T20:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex to parse the snmp inputs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491971#M84095</link>
      <description>&lt;P&gt;&lt;CODE&gt;mvexpand&lt;/CODE&gt; gives you a different event for each value in a multi-value field.  Using &lt;CODE&gt;mvindex&lt;/CODE&gt; keeps all of the fields associated with the same event.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 12:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-regex-to-parse-the-snmp-inputs/m-p/491971#M84095</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-02T12:57:52Z</dc:date>
    </item>
  </channel>
</rss>

