<?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 Dedup Field with event times as column headers in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493708#M137674</link>
    <description>&lt;P&gt;I have json data that comes in tracking ID's. An event is created when an ID is "created" and an event is created when an ID is "closed". Each event has the same alert ID and I'm struggling with a query that dedups the alert ID, and puts the times the ID's were created and closed in the columns. Looking for a table something like this: the times can be when the events were created or there is also a json field that's extracted as "date" Thanks in advance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID|  Created_Time | Closed_Time
  |
x | xxxxxxxxxxxx  | xxxxxxxx
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 May 2020 03:32:15 GMT</pubDate>
    <dc:creator>wwhite12</dc:creator>
    <dc:date>2020-05-12T03:32:15Z</dc:date>
    <item>
      <title>Dedup Field with event times as column headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493708#M137674</link>
      <description>&lt;P&gt;I have json data that comes in tracking ID's. An event is created when an ID is "created" and an event is created when an ID is "closed". Each event has the same alert ID and I'm struggling with a query that dedups the alert ID, and puts the times the ID's were created and closed in the columns. Looking for a table something like this: the times can be when the events were created or there is also a json field that's extracted as "date" Thanks in advance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID|  Created_Time | Closed_Time
  |
x | xxxxxxxxxxxx  | xxxxxxxx
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 03:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493708#M137674</guid>
      <dc:creator>wwhite12</dc:creator>
      <dc:date>2020-05-12T03:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup Field with event times as column headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493709#M137675</link>
      <description>&lt;P&gt;The &lt;CODE&gt;stats&lt;/CODE&gt; command can do that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats earliest(Created_Time) as Created_Time, latest(Closed_Time) as Closed_Time by ID
| table ID, Created_Time, Closed_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 12:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493709#M137675</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-05-12T12:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup Field with event times as column headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493710#M137676</link>
      <description>&lt;P&gt;What if Created_Time and Closed_Time are not pre-defined fields, is there a way I can pick the timestamp of an event if it contains "Created ID" and assign that to Created_Time and the same thing for Closed_Time?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:21:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493710#M137676</guid>
      <dc:creator>wwhite12</dc:creator>
      <dc:date>2020-09-30T05:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup Field with event times as column headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493711#M137677</link>
      <description>&lt;P&gt;Easy.  Set fields to _time when the target strings are detected.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Created_Time = if(searchmatch("Created ID"), _time, null)
| eval Closed_Time = if(searchmatch("Closed ID"), _time, null)
| stats earliest(Created_Time) as Created_Time, latest(Closed_Time) as Closed_Time by ID
| table ID, Created_Time, Closed_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 13:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493711#M137677</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-05-12T13:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup Field with event times as column headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493712#M137678</link>
      <description>&lt;P&gt;worked great thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 15:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-Field-with-event-times-as-column-headers/m-p/493712#M137678</guid>
      <dc:creator>wwhite12</dc:creator>
      <dc:date>2020-05-12T15:18:48Z</dc:date>
    </item>
  </channel>
</rss>

