<?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: Concatenating fields in a field transformation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438146#M124719</link>
    <description>&lt;P&gt;I'm using Splunk Cloud, so I cannot edit the .conf files directly. I'm restricted to only the web interface.&lt;/P&gt;

&lt;P&gt;I did try putting double quotes around the captures, but it seems they are ignored. &lt;CODE&gt;Player_"$1"_Score&lt;/CODE&gt; becomes &lt;CODE&gt;Player_$1_Score&lt;/CODE&gt;. I tried reversing it too, just in case. &lt;CODE&gt;"Player_"$1"_Score"&lt;/CODE&gt; also becomes &lt;CODE&gt;Player_$1_Score&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 14:57:00 GMT</pubDate>
    <dc:creator>wennebo1</dc:creator>
    <dc:date>2019-06-24T14:57:00Z</dc:date>
    <item>
      <title>Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438142#M124715</link>
      <description>&lt;P&gt;We are trying to extract both fields and their names from events that have a variable number of elements. We have determined that using a field transformation is the best way to do this, in order to have multi-valued fields. The names of the fields will be built using the elements in the event.&lt;/P&gt;

&lt;P&gt;An example event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 2019-06-21 14:30 Total Points Player: Red Score: 17,Player: Blue Score: 8,Player: Green Score: 12,Player: Blue Score: 11,Player: Yellow Score: 7,Player: Yellow Score: 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We would like to extract several fields that look like the this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Player_Red_Score: 17
 Player_Blue_Score: 8
                   11
 Player_Green_Score: 12
 Player_Yellow_Score: 7
                     10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field transformation regular expression is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (\w+) Score: (\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And its format is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Player_$1_Score::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But we end up with fields named &lt;CODE&gt;Player_$1_Score&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;How can we define custom names for these fields by concatenating static text with an extracted field name? I see that this can be done as shown in the documentation here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configureindex-timefieldextraction"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configureindex-timefieldextraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any idea what might be going wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438142#M124715</guid>
      <dc:creator>wennebo1</dc:creator>
      <dc:date>2019-06-21T19:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438143#M124716</link>
      <description>&lt;P&gt;Sounds like you're trying to do index time extraction with transforms. You may want to include your actual stanza to get the best advice. I'm not sure but you might need quotations around the captures, "$1" and "$2".&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 23:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438143#M124716</guid>
      <dc:creator>anthonymelita</dc:creator>
      <dc:date>2019-06-21T23:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438144#M124717</link>
      <description>&lt;P&gt;Hey there.&lt;/P&gt;

&lt;P&gt;Yes, some ideas. From your URL provided:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;In general, you should try to extract your fields at search time. However, there are times when you might find reason to add custom indexed fields. &lt;BR /&gt;
Do that instead: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I don't see a reason why you'd want to do index-time extractions here. It's just increasing disk space needed and rarely of use.&lt;/P&gt;

&lt;P&gt;Skalli&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 13:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438144#M124717</guid>
      <dc:creator>skalliger</dc:creator>
      <dc:date>2019-06-23T13:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438145#M124718</link>
      <description>&lt;P&gt;Unfortunately, I cannot use the field extractor for two reasons. First, because the resultant fields need to have multiple values per field. Second, because the field extractor cannot use event data in the field names. Neither of these can be done with the field extractor.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438145#M124718</guid>
      <dc:creator>wennebo1</dc:creator>
      <dc:date>2019-06-24T14:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438146#M124719</link>
      <description>&lt;P&gt;I'm using Splunk Cloud, so I cannot edit the .conf files directly. I'm restricted to only the web interface.&lt;/P&gt;

&lt;P&gt;I did try putting double quotes around the captures, but it seems they are ignored. &lt;CODE&gt;Player_"$1"_Score&lt;/CODE&gt; becomes &lt;CODE&gt;Player_$1_Score&lt;/CODE&gt;. I tried reversing it too, just in case. &lt;CODE&gt;"Player_"$1"_Score"&lt;/CODE&gt; also becomes &lt;CODE&gt;Player_$1_Score&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438146#M124719</guid>
      <dc:creator>wennebo1</dc:creator>
      <dc:date>2019-06-24T14:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438147#M124720</link>
      <description>&lt;P&gt;Hi @wennebo1,&lt;/P&gt;

&lt;P&gt;why not use a regex like this one : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Player\:\sRed Score\:\s+(?&amp;lt;Player_Red_Score&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use the same format for all colors without using an index time extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Player\:\sRed Score\:\s+(?&amp;lt;Player_Red_Score&amp;gt;\d+),Player\:\sBlue\sScore\:\s+(?&amp;lt;Player_Blue_Score&amp;gt;\d+),
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 15:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438147#M124720</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-24T15:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438148#M124721</link>
      <description>&lt;P&gt;Hello David,&lt;/P&gt;

&lt;P&gt;That's a good idea, and might be an option. I would need to make sure I know all the different players in advance, and update if new ones are added, which could get a little annoying.&lt;/P&gt;

&lt;P&gt;Even so, I would still need to use a field transformation to allow each field to hold multiple values.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 15:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438148#M124721</guid>
      <dc:creator>wennebo1</dc:creator>
      <dc:date>2019-06-24T15:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating fields in a field transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438149#M124722</link>
      <description>&lt;P&gt;After gaining a better understanding of search-time and index-time extractions, I found out what the problem was.&lt;/P&gt;

&lt;P&gt;The transformations available for editing in Splunk Cloud can &lt;EM&gt;only&lt;/EM&gt; be used for search-time extractions. From the page on &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/7.2.6/Knowledge/Managesearch-timefieldextractions"&gt;field extractions&lt;/A&gt;:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;You cannot manage index-time field extractions in Splunk Web.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And, from the page on &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Admin/Transformsconf"&gt;transformations.conf&lt;/A&gt;:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE&gt;* At index time only, you can use FORMAT to create concatenated fields:
* Example: FORMAT = ipaddress::$1.$2.$3.$4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you will either need to use the method suggested by @DavidHourani, or submit a ticket to Splunk to request a new index-time field extraction.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Not ideal, but this should clarify the problem if anyone else has the same issue.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 17:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenating-fields-in-a-field-transformation/m-p/438149#M124722</guid>
      <dc:creator>wennebo1</dc:creator>
      <dc:date>2019-06-24T17:13:53Z</dc:date>
    </item>
  </channel>
</rss>

