<?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 How to add values from a split to an existing field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625681#M217478</link>
    <description>&lt;P&gt;Hello, i'm trying to add values to an existing field but i'm running into a wall.&lt;/P&gt;
&lt;P&gt;I have a field name vector and another field name source, the pattern of the source field is XXX - YYY - ZZZ,&lt;/P&gt;
&lt;P&gt;i only want to keep the XXX part, so i've done&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval temp = mvindex(split(source, " - "),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then i try to add these result to the vector field like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|eval vector = vector + temp&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you help me ?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2023 16:08:54 GMT</pubDate>
    <dc:creator>fatanyk</dc:creator>
    <dc:date>2023-01-03T16:08:54Z</dc:date>
    <item>
      <title>How to add values from a split to an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625681#M217478</link>
      <description>&lt;P&gt;Hello, i'm trying to add values to an existing field but i'm running into a wall.&lt;/P&gt;
&lt;P&gt;I have a field name vector and another field name source, the pattern of the source field is XXX - YYY - ZZZ,&lt;/P&gt;
&lt;P&gt;i only want to keep the XXX part, so i've done&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval temp = mvindex(split(source, " - "),0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then i try to add these result to the vector field like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;|eval vector = vector + temp&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you help me ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 16:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625681#M217478</guid>
      <dc:creator>fatanyk</dc:creator>
      <dc:date>2023-01-03T16:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add values from a split to an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625703#M217487</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Do you know for sure if the&amp;nbsp;&lt;SPAN&gt;source field exists in 100% of the events?&amp;nbsp;&lt;/SPAN&gt;Sometimes concatenating fields fails because one of the fields doesn't exist on all events.&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;PRE&gt;| eval vector = if(isnull(temp), vector, vector.temp)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also try to concatenate using the "." instead of "+"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval vector = vector.temp&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;If this reply helps you, Karma would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 13:03:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625703#M217487</guid>
      <dc:creator>goncalocoelho</dc:creator>
      <dc:date>2023-01-03T13:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add values from a split to an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625707#M217488</link>
      <description>&lt;P&gt;No, the source field does not exist in 100% of the events, in fact I want to create the field "vector" for the events that do not have it with the value XXX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've try both of your solutions but neither worked.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 13:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625707#M217488</guid>
      <dc:creator>fatanyk</dc:creator>
      <dc:date>2023-01-03T13:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add values from a split to an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625718#M217491</link>
      <description>&lt;P&gt;If vector doesn't exist, and you are creating it based on source, then try this:&lt;/P&gt;&lt;PRE&gt;| eval vector = if(isnull(temp), "&amp;lt;null or something else&amp;gt;", temp)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;If this reply helps you, Karma would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 14:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625718#M217491</guid>
      <dc:creator>goncalocoelho</dc:creator>
      <dc:date>2023-01-03T14:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add values from a split to an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625727#M217495</link>
      <description>&lt;P&gt;it works thank you !&lt;/P&gt;&lt;P&gt;Actually it looks like this :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval vector= if(isnull(temp),vector,temp)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Jan 2023 15:51:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-values-from-a-split-to-an-existing-field/m-p/625727#M217495</guid>
      <dc:creator>fatanyk</dc:creator>
      <dc:date>2023-01-03T15:51:30Z</dc:date>
    </item>
  </channel>
</rss>

