<?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: Field Transform not outputting any data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14038#M1422</link>
    <description>&lt;P&gt;Just to clarify, this restriction on multiple fields in a value is for search-time extractions. You &lt;EM&gt;can&lt;/EM&gt; use multiple in index-time transforms.&lt;/P&gt;

&lt;P&gt;It's not well-documented, but it is a consequence of how search-time extractions work currently.&lt;/P&gt;</description>
    <pubDate>Sat, 22 May 2010 08:12:14 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-05-22T08:12:14Z</dc:date>
    <item>
      <title>Field Transform not outputting any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14036#M1420</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've created the following field extraction and field transform in their respective files - props.conf and transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[convert_mac_address_from_msdhcp]
FORMAT = client_mac_address::$1-$2-$3-$4-$5-$6
REGEX = ,(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2}),$

[msdhcp]
REPORT-client_mac_address = convert_mac_address_from_msdhcp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When doing a search, 'client_mac_address' appears but with a value of '$1-$2-$3-$4-$5-$6' and not, for example, '00-56-89-23-44-22' as I would expect. If I change the FORMAT line in the transform to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FORMAT = client_mac_address::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the first two alphanumeric characters returned as expected i.e 07, so why does it break if using multiple $n?&lt;/P&gt;

&lt;P&gt;Can anyone tell me why this is not working?&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2010 22:58:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14036#M1420</guid>
      <dc:creator>sidafydd</dc:creator>
      <dc:date>2010-05-21T22:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Field Transform not outputting any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14037#M1421</link>
      <description>&lt;P&gt;You can't use multiple regex capture groups for a single field with Splunk's field-extraction.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;I'm not sure that this limitation is clearly documented.  If so, does anybody have a link?&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;For example:   &lt;CODE&gt;FORMAT = my_var::$1_$2&lt;/CODE&gt; does not work because you are referencing two groups.  Also, you can't use something like &lt;CODE&gt;FORMAT = my_var::a_constant_string-$1&lt;/CODE&gt;.  You can only reference one group at a time with field-extraction (search time) and can't use text to augment your value either.  Now, you can use multiple groups with an indexed field (which, as it sounds, is handled at index time), however there are many other downsides to indexed field that make this less than ideal.  So I don't recommend that using them without some serious consideration and a good understanding of their pros/cons.&lt;/P&gt;

&lt;P&gt;Here are two discussions on this topic that I think you will find helpful:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://answers.splunk.com/questions/2032/transforming-an-ip/2034#2034" rel="nofollow"&gt;transforming an ip&lt;/A&gt; -- This one is the most related to your question.  Some of the alternate approaches mentioned could be adapted to work in your situation.&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://answers.splunk.com/questions/842/do-search-time-fields-have-performance-considerations/847#847" rel="nofollow"&gt;Do search-time fields have performance considerations?&lt;/A&gt; -- This has some helpful pros/cons about indexed fields vs extracted fields.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Here is another search-time workaround that could try:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | rex ",(?&amp;lt;client_mac_address&amp;gt;\d{12}),$" | rex mode=sed field=client_mac_address "s/(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/\1-\2-\3-\4-\5-\6/"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Another option would be to use a &lt;CODE&gt;SEDCMD&lt;/CODE&gt; index-time transformation to do this at index time.&lt;/P&gt;

&lt;P&gt;Also, I notice that you're looking for commas before and after your MAC address.  If you have a CSV-style file than you can use delimited field extraction options.  Look for &lt;CODE&gt;FIELDS&lt;/CODE&gt; and &lt;CODE&gt;DELIMS&lt;/CODE&gt; in the &lt;CODE&gt;transforms.conf&lt;/CODE&gt; docs.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2010 23:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14037#M1421</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-21T23:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field Transform not outputting any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14038#M1422</link>
      <description>&lt;P&gt;Just to clarify, this restriction on multiple fields in a value is for search-time extractions. You &lt;EM&gt;can&lt;/EM&gt; use multiple in index-time transforms.&lt;/P&gt;

&lt;P&gt;It's not well-documented, but it is a consequence of how search-time extractions work currently.&lt;/P&gt;</description>
      <pubDate>Sat, 22 May 2010 08:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14038#M1422</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-22T08:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field Transform not outputting any data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14039#M1423</link>
      <description>&lt;P&gt;Thanks for the information. I had read &lt;A href="http://www.splunk.com/base/Documentation/latest/Knowledge/Managefieldtransforms"&gt;http://www.splunk.com/base/Documentation/latest/Knowledge/Managefieldtransforms&lt;/A&gt; and had assumed that it was applicable to search-time extractions as well.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2010 15:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Transform-not-outputting-any-data/m-p/14039#M1423</guid>
      <dc:creator>sidafydd</dc:creator>
      <dc:date>2010-05-24T15:55:24Z</dc:date>
    </item>
  </channel>
</rss>

