<?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 Create a new field/column on an event based on another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217220#M63796</link>
    <description>&lt;P&gt;I am new to Splunk and I am creating a dashboard with events. I would like to create a new field on the event which will have a value based on another field. &lt;/P&gt;

&lt;P&gt;P.S I already included the existing field as part of search .&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;When existing field has 'XXX' in it, I need to populate 'ABC' in the new field and 'YYY' as 'CDE' &lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 20:48:14 GMT</pubDate>
    <dc:creator>hariivendiran</dc:creator>
    <dc:date>2016-06-22T20:48:14Z</dc:date>
    <item>
      <title>Create a new field/column on an event based on another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217220#M63796</link>
      <description>&lt;P&gt;I am new to Splunk and I am creating a dashboard with events. I would like to create a new field on the event which will have a value based on another field. &lt;/P&gt;

&lt;P&gt;P.S I already included the existing field as part of search .&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;When existing field has 'XXX' in it, I need to populate 'ABC' in the new field and 'YYY' as 'CDE' &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217220#M63796</guid>
      <dc:creator>hariivendiran</dc:creator>
      <dc:date>2016-06-22T20:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new field/column on an event based on another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217221#M63797</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval newfield=case(existingfield="XXX", "AAA", existingfield="YYY", "CDE", 1=1, null()) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 21:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217221#M63797</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-22T21:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new field/column on an event based on another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217222#M63798</link>
      <description>&lt;P&gt;Your sentence can be read 2 ways.  @sundareshr has interpreted and answered it one way, here is the other:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval newfield=if(existingfield="XXX", "AAA", null()) | eval YYY=if(existingfield="XXX", "CDE", null()) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jun 2016 02:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-field-column-on-an-event-based-on-another-field/m-p/217222#M63798</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-24T02:19:30Z</dc:date>
    </item>
  </channel>
</rss>

