<?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 How to handle fieldname=name, fieldvalue=value in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164549#M33368</link>
    <description>&lt;P&gt;I currently have data that I want to extract fields from that looks like this&lt;/P&gt;

&lt;P&gt;fieldname1=name1, fieldvalue1=value1, fieldname2=name2, fieldvalue2=value2&lt;/P&gt;

&lt;P&gt;I want to extract the fields and make it look like this.&lt;/P&gt;

&lt;P&gt;name1=value1&lt;BR /&gt;
name2=value2&lt;/P&gt;

&lt;P&gt;Is this possible with Splunk through modifications to the props.conf and transforms.conf?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2014 20:47:34 GMT</pubDate>
    <dc:creator>mikedgibson</dc:creator>
    <dc:date>2014-05-14T20:47:34Z</dc:date>
    <item>
      <title>How to handle fieldname=name, fieldvalue=value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164549#M33368</link>
      <description>&lt;P&gt;I currently have data that I want to extract fields from that looks like this&lt;/P&gt;

&lt;P&gt;fieldname1=name1, fieldvalue1=value1, fieldname2=name2, fieldvalue2=value2&lt;/P&gt;

&lt;P&gt;I want to extract the fields and make it look like this.&lt;/P&gt;

&lt;P&gt;name1=value1&lt;BR /&gt;
name2=value2&lt;/P&gt;

&lt;P&gt;Is this possible with Splunk through modifications to the props.conf and transforms.conf?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 20:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164549#M33368</guid>
      <dc:creator>mikedgibson</dc:creator>
      <dc:date>2014-05-14T20:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle fieldname=name, fieldvalue=value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164550#M33369</link>
      <description>&lt;P&gt;Sure, you can define your own key/value extraction transforms. Something like this should do it:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
REPORT-fieldkv = fieldkv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fieldkv]
REGEX = fieldname\d+=([^,]+), fieldvalue\d+=([^,]+)
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 May 2014 20:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164550#M33369</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-05-14T20:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle fieldname=name, fieldvalue=value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164551#M33370</link>
      <description>&lt;P&gt;Thanks. Sorry, I messed up my sample a little bit. It could look like this.&lt;/P&gt;

&lt;P&gt;field name1=name 1 field value1=value 1 field name2=name 2 field value2=value2&lt;/P&gt;

&lt;P&gt;It is using space delimiters (not commas) and unfortunately the field names and values can have spaces and I can't control the order of the fields other than to know field 1 value always follows field 1 name.&lt;/P&gt;

&lt;P&gt;I only have basic regex experience and not sure if there is anything that can cover that.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 21:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164551#M33370</guid>
      <dc:creator>mikedgibson</dc:creator>
      <dc:date>2014-05-14T21:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle fieldname=name, fieldvalue=value</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164552#M33371</link>
      <description>&lt;P&gt;You might be able to adapt the extraction like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = field name\d+=([^=]+?) field value\d+=(([^=]+?)(?= field name\d+)|(.*))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's assuming the event ends after the last field.&lt;BR /&gt;
Look for the field name, grab that, look for the field value, grab that until the start of the next field or grab until the end if there's no other field name coming.&lt;/P&gt;

&lt;P&gt;Note, and that's a big note, extracting data like this is quite fragile.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 00:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-fieldname-name-fieldvalue-value/m-p/164552#M33371</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-05-15T00:51:24Z</dc:date>
    </item>
  </channel>
</rss>

