<?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: Dynamic field extraction name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98790#M25462</link>
    <description>&lt;P&gt;This requires me to write a regex for every single group of statistics we have. There are hundreds of them, they change frequently, and some of them are even dynamic (they come and go automatically).&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2013 12:05:24 GMT</pubDate>
    <dc:creator>phemmer</dc:creator>
    <dc:date>2013-04-18T12:05:24Z</dc:date>
    <item>
      <title>Dynamic field extraction name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98788#M25460</link>
      <description>&lt;P&gt;I am trying to extract some fields from some reporting data. The reporting data has a field name, and then a bunch of metrics related to that field. For example a log entry might look like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;report=memory ram_used=123mb;500;600;0;700 swap_used=456mb;1100;1200;0;1300
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Each of the stats is "{CURRENT}[UNIT];{WARNING};{CRITICAL};{MINIMUM};{MAXIMUM}". I want to end up with fields such as &lt;CODE&gt;ram_used_current=123&lt;/CODE&gt;, &lt;CODE&gt;ram_used_unit=mb&lt;/CODE&gt;, &lt;CODE&gt;swap_used_max=1300&lt;/CODE&gt;, etc.&lt;BR /&gt;&lt;BR /&gt;
My first thought was to solve this by doing a transform such as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[reporting]
REGEX = ([^\s=]+)=([0-9\.\-\+_]+)([a-zA-Z]*);([^\s;]*);([^\s;]*);([^\s;]*);([^\s;]*)
FORMAT = $1_current::$2 $1_unit::3 $1_warn::$4 $1_crit::$5 $1_min::$6 $1_max::$7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this doesn't appear to work. It looks like it's just setting fields such as &lt;CODE&gt;current&lt;/CODE&gt; instead of the desired &lt;CODE&gt;ram_used_current&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I know in the transforms.conf documentation it says you cannot concatenate fields, but I'm assuming this means values, and not the field names. As you can create whatever field names you want by doing named regexes, so this seems to indicate the engine is capable of handling it.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2013 03:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98788#M25460</guid>
      <dc:creator>phemmer</dc:creator>
      <dc:date>2013-04-18T03:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field extraction name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98789#M25461</link>
      <description>&lt;P&gt;You could make that as an EXTRACT in props.conf only. It will not alter the events, like a transform would do. It will work on already indexed data.&lt;/P&gt;

&lt;P&gt;Something like this (not extracting the unit);&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your sourcetype]
EXTRACT-YYY = ram_used=(?&amp;lt;ram_used_current&amp;gt;\d+)\w+;(?&amp;lt;ram_used_warn&amp;gt;\d+);(?&amp;lt;ram_used_crit&amp;gt;\d+);(?&amp;lt;ram_used_min&amp;gt;\d+);(?&amp;lt;ram_used_max&amp;gt;\d+);
EXTRACT-XXX = swap_used=(?&amp;lt;swap_used_current&amp;gt;\d+) etc etc etc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2013 10:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98789#M25461</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-18T10:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field extraction name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98790#M25462</link>
      <description>&lt;P&gt;This requires me to write a regex for every single group of statistics we have. There are hundreds of them, they change frequently, and some of them are even dynamic (they come and go automatically).&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2013 12:05:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-field-extraction-name/m-p/98790#M25462</guid>
      <dc:creator>phemmer</dc:creator>
      <dc:date>2013-04-18T12:05:24Z</dc:date>
    </item>
  </channel>
</rss>

