<?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: concat two fields into one in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75712#M15453</link>
    <description>&lt;P&gt;My bad - this cannot be done with search-time extractions, just at index-time, as described in transforms.conf.spec. You need TRANSFORMS instead of REPORT. Updating my answer to reflect that.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2011 21:33:06 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-09-14T21:33:06Z</dc:date>
    <item>
      <title>concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75703#M15444</link>
      <description>&lt;P&gt;ok, we have a field defined (user), and for another sourcetype I have the extracts already occurring for appUser and and appDomain.. so for this sourcetype I want user to be overriden as appUser@appDomain.&lt;/P&gt;

&lt;P&gt;my guess would be index time? But I don't really care as long as it works.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 18:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75703#M15444</guid>
      <dc:creator>mmattek</dc:creator>
      <dc:date>2011-09-14T18:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75704#M15445</link>
      <description>&lt;P&gt;Why not just use rename as?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 18:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75704#M15445</guid>
      <dc:creator>bobbole7</dc:creator>
      <dc:date>2011-09-14T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75705#M15446</link>
      <description>&lt;P&gt;How do you know which user corresponds to which appUser@appDomain?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 19:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75705#M15446</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-14T19:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75706#M15447</link>
      <description>&lt;P&gt;can I do that in props or something? I know I can do it in an individual search, but I need it done for everyone.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 19:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75706#M15447</guid>
      <dc:creator>mmattek</dc:creator>
      <dc:date>2011-09-14T19:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75707#M15448</link>
      <description>&lt;P&gt;I may not be making this clear.. there is already an extract for appUser and appDomain. We have a generic (more than this app) field called "user" and I want to concat these two fields with an "@" sign in the middle. I don't want the user to have to do this in every search (I don't really care if it is done at index time or not)&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 19:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75707#M15448</guid>
      <dc:creator>mmattek</dc:creator>
      <dc:date>2011-09-14T19:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75708#M15449</link>
      <description>&lt;P&gt;So when the user issues the search, the returned fields include "user", "appUser" and "appDomain"?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 19:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75708#M15449</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-14T19:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75709#M15450</link>
      <description>&lt;P&gt;Quick and easy solution would be to use &lt;CODE&gt;eval&lt;/CODE&gt; or &lt;CODE&gt;strcat&lt;/CODE&gt; to concatenate the field values together. Like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourbasesearch&amp;gt; | eval user=appUser."@".appDomain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you (or your users) don't want to have to specify that in every search though, you &lt;EM&gt;kind of&lt;/EM&gt; can concatenate your appUser and appDomain values to the user field in &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt;. The idea would be to take the regex for one of them then glue it together with the regex for the other using some generic matching regex between them, match both fields then combine them. NOTE: this can be done ONLY for index-time extractions. Concatenating fields together in this way does not work with search-time extractions. At search-time you'd have to use the eval solution.&lt;/P&gt;

&lt;P&gt;In props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
TRANSFORMS-user = extractuser
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extractuser]
REGEX = (the appUser regex).+?(the appDomain regex)
FORMAT = user::$1@$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2011 20:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75709#M15450</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-14T20:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75710#M15451</link>
      <description>&lt;P&gt;thanks.. that is sort of working, but it isn't substituing correctly (just leaving $1@$2 for the field value). I suspect its because I'm trying to use SOURCE_KEY={another extracted field from a previous transform} I guess I have to regex from the overall raw log message?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 20:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75710#M15451</guid>
      <dc:creator>mmattek</dc:creator>
      <dc:date>2011-09-14T20:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75711#M15452</link>
      <description>&lt;P&gt;looking at:&lt;BR /&gt;
&lt;A href="http://www.splunk.com/support/forum:SplunkGeneral/2684"&gt;http://www.splunk.com/support/forum:SplunkGeneral/2684&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;it looks like maybe this isn't doable with extracted fields?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 21:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75711#M15452</guid>
      <dc:creator>mmattek</dc:creator>
      <dc:date>2011-09-14T21:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75712#M15453</link>
      <description>&lt;P&gt;My bad - this cannot be done with search-time extractions, just at index-time, as described in transforms.conf.spec. You need TRANSFORMS instead of REPORT. Updating my answer to reflect that.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 21:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75712#M15453</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-14T21:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: concat two fields into one</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75713#M15454</link>
      <description>&lt;P&gt;Correct. Concatenating different values for one single field when doing extractions is possible with index-time extractions only.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2011 21:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/concat-two-fields-into-one/m-p/75713#M15454</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-14T21:36:34Z</dc:date>
    </item>
  </channel>
</rss>

