<?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 a new field from the value of another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228038#M67379</link>
    <description>&lt;P&gt;this is getting the fields created. the networkzone field is only bringing in the underscore. i am working with it to see if it will give me exactly what i need. thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2016 16:43:28 GMT</pubDate>
    <dc:creator>rwiley</dc:creator>
    <dc:date>2016-11-15T16:43:28Z</dc:date>
    <item>
      <title>How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228033#M67374</link>
      <description>&lt;P&gt;i have a search with these results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;description,     stringValue
datetime,        "epoc time"
zone,            "zonename"
network,         "networkname"
etc,             etc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i want to create a field called date from string value when description = datetime and a field called NetworkZone from stringvalue when description = network get stringvalue "_" when value = zone get string value&lt;/P&gt;

&lt;P&gt;so datetime form date time and "network_zone" from network and zone.&lt;/P&gt;

&lt;P&gt;i have used eval to combine fields but not to use the values as a new field. not sure if it is possible. thanks for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228033#M67374</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-11-14T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228034#M67375</link>
      <description>&lt;P&gt;How about this? This should create a new field with name same as value of the field description and value of this new field will be same as field stringValue.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval "{description}"=stringValue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:27:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228034#M67375</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-14T15:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228035#M67376</link>
      <description>&lt;P&gt;Hi rwiley,&lt;BR /&gt;
try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval date=if(description="datetime",stringValue,""), NetworkZone=if(description="network","__",if(value="zone",stringValue,"") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure to have understood the second condition.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228035#M67376</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-14T15:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228036#M67377</link>
      <description>&lt;P&gt;that will create a new field but i only want the value of stringvalue when the description = a certain value. &lt;/P&gt;

&lt;P&gt;so i need a field called network_zone where it only pulls the network name and zone name. and a date field that only gets the stringValue when description = date. something like this. &lt;/P&gt;

&lt;P&gt;decription, stringValue&lt;BR /&gt;
date, date&lt;BR /&gt;
network, networkname&lt;BR /&gt;
zone, zonename&lt;/P&gt;

&lt;P&gt;new fields&lt;BR /&gt;
date, netoworkzone&lt;BR /&gt;
date, "networkname"+"_"+"zonename"&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228036#M67377</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-11-14T15:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228037#M67378</link>
      <description>&lt;P&gt;In that case, you will need to create a separate eval for each new field which will populate it conditionally. Also, you want to merge two events which has network and zone as one value, so that would add extra step. See if something like this works for you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval description=if(description="network" OR description="zone","network_zone",description) 
|stats values(stringValue) as stringValue by description delim="_" | nomv stringValue
| eval date=if(description="date",stringValue,null()) | eval network_zone=if(description="network_zone",stringValue,null()) | ...any other combination...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Give this a try as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval description=if(description="network" OR description="zone","network_zone",description) 
| stats values(stringValue) as stringValue by description delim="_" 
| nomv stringValue | eval temp=1 
| xyseries temp description stringValue | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 15:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228037#M67378</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-14T15:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field from the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228038#M67379</link>
      <description>&lt;P&gt;this is getting the fields created. the networkzone field is only bringing in the underscore. i am working with it to see if it will give me exactly what i need. thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 16:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-from-the-value-of-another-field/m-p/228038#M67379</guid>
      <dc:creator>rwiley</dc:creator>
      <dc:date>2016-11-15T16:43:28Z</dc:date>
    </item>
  </channel>
</rss>

