<?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: Replacing field value of one event with another event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-field-value-of-one-event-with-another-event/m-p/510572#M142920</link>
    <description>&lt;P&gt;I am assuming your example shows the word "Null" as the text value rather than Splunk 'null', so in that case, this is an example where I have shown your data plus a couple of additional games to demonstrate the point.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  makeresults
|  eval _raw="ProductName,categoryId
Benign Space Debris,Arcade
Orvil The Wolverine,Arcade
Some Other Game,Board
Another New Game,Null
Orvil The Wolverine,Null
Another New Game,Ball
Benign Space Debris,Null
Some Other Game,Null"
|  multikv forceheader=1
|  table ProductName categoryId
|  rename "COMMENT" as "Above this line is your data setup"
|  eval categoryId=nullif(categoryId, "Null")
|  sort ProductName, categoryId
|  filldown categoryId&lt;/LI-CODE&gt;&lt;P&gt;This works by ensuring that the text "Null" is converted to a Splunk null and then sorts the data by ProductName and categoryId, which is ensuring that the null entries are at the end of the product name.&lt;/P&gt;&lt;P&gt;It then uses filldown to take a current categoryId and places it in subsequent null records below.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 04:19:41 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-07-23T04:19:41Z</dc:date>
    <item>
      <title>How to replace field value of one event with another event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-field-value-of-one-event-with-another-event/m-p/510569#M142918</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Annotation 2020-07-23 120100.png" style="width: 720px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9834i4A5E737797EBCF41/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation 2020-07-23 120100.png" alt="Annotation 2020-07-23 120100.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is the data set from Fundamental 1.&lt;/P&gt;
&lt;P&gt;A lot of successful purchase events with same 'ProductName' doesn't include 'categoryId' as a field. So I want to put/replace the null 'categoryId' field with 'categoryId' which have the same 'ProductName'. How do I do it and scale it up to multiple events?&lt;/P&gt;
&lt;P&gt;For example, I want the Null value in the screenshot above replaced by the categoryId of the same ProductName.&lt;/P&gt;
&lt;P&gt;I hope I word this out clearly. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 05:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-field-value-of-one-event-with-another-event/m-p/510569#M142918</guid>
      <dc:creator>FaridHamidi</dc:creator>
      <dc:date>2020-07-23T05:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing field value of one event with another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-field-value-of-one-event-with-another-event/m-p/510572#M142920</link>
      <description>&lt;P&gt;I am assuming your example shows the word "Null" as the text value rather than Splunk 'null', so in that case, this is an example where I have shown your data plus a couple of additional games to demonstrate the point.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  makeresults
|  eval _raw="ProductName,categoryId
Benign Space Debris,Arcade
Orvil The Wolverine,Arcade
Some Other Game,Board
Another New Game,Null
Orvil The Wolverine,Null
Another New Game,Ball
Benign Space Debris,Null
Some Other Game,Null"
|  multikv forceheader=1
|  table ProductName categoryId
|  rename "COMMENT" as "Above this line is your data setup"
|  eval categoryId=nullif(categoryId, "Null")
|  sort ProductName, categoryId
|  filldown categoryId&lt;/LI-CODE&gt;&lt;P&gt;This works by ensuring that the text "Null" is converted to a Splunk null and then sorts the data by ProductName and categoryId, which is ensuring that the null entries are at the end of the product name.&lt;/P&gt;&lt;P&gt;It then uses filldown to take a current categoryId and places it in subsequent null records below.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 04:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-field-value-of-one-event-with-another-event/m-p/510572#M142920</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-23T04:19:41Z</dc:date>
    </item>
  </channel>
</rss>

