<?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: How to create unique field names from two data sources that share a common field name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278675#M84169</link>
    <description>&lt;P&gt;I'd considered that, but wasn't quite sure how to place the coalesce into an "if" block&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2016 00:06:48 GMT</pubDate>
    <dc:creator>pkeller</dc:creator>
    <dc:date>2016-02-11T00:06:48Z</dc:date>
    <item>
      <title>How to create unique field names from two data sources that share a common field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278671#M84165</link>
      <description>&lt;P&gt;I have two data sources, each with a field named &lt;STRONG&gt;foo&lt;/STRONG&gt;.&lt;BR /&gt;
Each data source has a different sourcetype, so I'd like to do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=STa) OR (sourcetype=STb) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if sourcetype is STa, I'd like to rename foo to fooA&lt;BR /&gt;
if sourcetype is STb, I'd like to rename foo to fooB&lt;/P&gt;

&lt;P&gt;Using &lt;CODE&gt;eval fooA = coalesce(foo,NULL)&lt;/CODE&gt; works, but I'm not sure how to make it conditional so that it only acts on events with the STa sourcetype.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 22:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278671#M84165</guid>
      <dc:creator>pkeller</dc:creator>
      <dc:date>2016-02-10T22:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create unique field names from two data sources that share a common field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278672#M84166</link>
      <description>&lt;P&gt;You can use the following technique:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval fooA = if(sourcetype == "STa", foo, "")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the same for fooB&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 23:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278672#M84166</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-10T23:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create unique field names from two data sources that share a common field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278673#M84167</link>
      <description>&lt;P&gt;IMO, the coalesce approach is what's needed here. It'll run for each event (for both sourcetypes) but so as any rename command.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 23:21:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278673#M84167</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-10T23:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create unique field names from two data sources that share a common field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278674#M84168</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 23:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278674#M84168</guid>
      <dc:creator>pkeller</dc:creator>
      <dc:date>2016-02-10T23:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create unique field names from two data sources that share a common field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278675#M84169</link>
      <description>&lt;P&gt;I'd considered that, but wasn't quite sure how to place the coalesce into an "if" block&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 00:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-unique-field-names-from-two-data-sources-that/m-p/278675#M84169</guid>
      <dc:creator>pkeller</dc:creator>
      <dc:date>2016-02-11T00:06:48Z</dc:date>
    </item>
  </channel>
</rss>

