<?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: Copy field to another event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484253#M140362</link>
    <description>&lt;P&gt;Awesome, glad I could help ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Apr 2020 07:16:53 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2020-04-30T07:16:53Z</dc:date>
    <item>
      <title>Copy field to another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484249#M140358</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm searching doing a search in splunk for the "request_id" field. For example: request_id = "XXXXXXX"&lt;BR /&gt;
It returns data from 2 sources. I can do a dedup and get the last event and it has everything I need except for the duration field. Is there a way I can pass the duration field and the value to another event before running dedup?&lt;/P&gt;

&lt;P&gt;If yes, how can I do this in bulk? I have a subsearch with a table of request_id's. I use it to search for all events matching those request_id's. How can I make sure that for each individual request_id, the duration field is populated for all events?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484249#M140358</guid>
      <dc:creator>mihirpradhan</dc:creator>
      <dc:date>2020-09-30T05:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy field to another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484250#M140359</link>
      <description>&lt;P&gt;yes, use &lt;CODE&gt;stats range&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 03:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484250#M140359</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-29T03:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Copy field to another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484251#M140360</link>
      <description>&lt;P&gt;Hi @mihirpradhan,&lt;/P&gt;

&lt;P&gt;Instead of &lt;CODE&gt;dedup&lt;/CODE&gt; you can combine the events from multiple sources using &lt;CODE&gt;stats&lt;/CODE&gt; as follows :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourIndexAndSourcetype request_id = "XXXXXXX"  | stats latest(duration) as duration, latest(fieldYouNeed) as fieldYouNeed by request_id 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you need all the field, you can use a wildcard for your stats command : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; yourIndexAndSourcetype request_id = "XXXXXXX"  | stats latest(*) as * by request_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This not only removes duplicates but also allows you to control what you keep from each event.&lt;/P&gt;

&lt;P&gt;Let me know if this helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 05:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484251#M140360</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2020-04-29T05:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Copy field to another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484252#M140361</link>
      <description>&lt;P&gt;That worked perfect. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;stats latest(*) as * by request_id&lt;/CODE&gt; is exactly what I was looking for!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 02:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484252#M140361</guid>
      <dc:creator>mihirpradhan</dc:creator>
      <dc:date>2020-04-30T02:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copy field to another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484253#M140362</link>
      <description>&lt;P&gt;Awesome, glad I could help ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Copy-field-to-another-event/m-p/484253#M140362</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2020-04-30T07:16:53Z</dc:date>
    </item>
  </channel>
</rss>

