<?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 Does each Splunk event have a unique identifier? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9126#M20</link>
    <description>&lt;P&gt;I would like to tag some specific events to group them together for incident response and forensics purposes.  Is this possible with Splunk?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2010 02:52:14 GMT</pubDate>
    <dc:creator>araitz</dc:creator>
    <dc:date>2010-01-15T02:52:14Z</dc:date>
    <item>
      <title>Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9126#M20</link>
      <description>&lt;P&gt;I would like to tag some specific events to group them together for incident response and forensics purposes.  Is this possible with Splunk?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2010 02:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9126#M20</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2010-01-15T02:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9127#M21</link>
      <description>&lt;P&gt;No, it is not yet.&lt;/P&gt;

&lt;P&gt;Each event does have a unique id, the tuple (splunk_server, index, _cd), but "_cd" is not searchable (only filterable). You could use lookup tables to map this to a tag or key.&lt;/P&gt;

&lt;P&gt;When we make _cd searchable, that will allow searching on the tags or groups.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2010 02:58:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9127#M21</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-01-15T02:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9128#M22</link>
      <description>&lt;P&gt;Any updates on being able to tag specific events or time frame when this functionality might be available?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2011 17:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9128#M22</guid>
      <dc:creator>deloach</dc:creator>
      <dc:date>2011-08-10T17:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9129#M23</link>
      <description>&lt;P&gt;any update?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 16:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9129#M23</guid>
      <dc:creator>pembleton</dc:creator>
      <dc:date>2013-07-11T16:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9130#M24</link>
      <description>&lt;P&gt;Update for Splunk 6.2.1. &lt;/P&gt;

&lt;P&gt;_cd is still not searchable after 5 years. I suggest using the following method which calculates a hash based on the raw event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here | eval id=md5(_raw) | id="VALUE_YOU_ARE_LOOKING_FOR"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2015 12:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9130#M24</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2015-07-21T12:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9131#M25</link>
      <description>&lt;P&gt;I've found that you can at least access _cd for a stats if you do a rename first:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| rename _cd as unique_id&lt;BR /&gt;
| stats count by unique_id&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you want to search on that data, you can do this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=awesome sourcetype=woah&lt;BR /&gt;
rename _cd as unique_id&lt;BR /&gt;
| search unique_id=9320:49207386&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:30:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9131#M25</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2020-09-29T09:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9132#M26</link>
      <description>&lt;P&gt;I downvoted this post because there is a newer and better answer&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9132#M26</guid>
      <dc:creator>christianhuber</dc:creator>
      <dc:date>2017-06-14T13:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9133#M27</link>
      <description>&lt;P&gt;I feel it is unfair to downvote an answer after 7+ years. (may be at that time, it was the only solution.). &lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 09:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9133#M27</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-06-23T09:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9134#M28</link>
      <description>&lt;P&gt;So there's been some movement on this question in the recent weeks, so I'll drop in and give some commentary.  Hopefully this helps someone.   Bottom line, there still isn't a really good answer to this, as far as I know.  Most of when I hear this question asked, it's because of a misunderstanding of what Splunk does and how it works.  If you really need a feature like this, open a splunk support ticket and explain your use case (that's how new features like this get introduced.)  Otherwise, enjoy the following weeds:&lt;/P&gt;

&lt;P&gt;Before going much further let me point out that Sorkin's answer was from before Splunk indexer clustering, and therefore won't work reliably in on clustered environments today.  The answer with the next highest points (mikaelbje) shows an id based on a hash of the event's raw text.   But there's no fundamental guarantee of uniqueness for _raw (e.g., the same message could repeat multiple time per second, or data could be ingested twice, ...), and more importantly, there's no fast way to search on it.  If you're trying to pick out one event out of a few thousand, then this is probably acceptable, but it does not scale.  (This is because Splunk has to pull back every event from disk, then calculate the checksum, and then compare it.  There's no fast index operations involved, therefore it will be slow.)&lt;/P&gt;

&lt;P&gt;So there's a couple issues that index clustering bring to the mix that changes things dramatically.  First, with bucket replication, there's no guarantee that the same indexer will always be returning the same event in the future, it could easily be handled off to another peer who has a replicated copy.  (Also note that &lt;CODE&gt;splunk_server&lt;/CODE&gt; represents the current &lt;CODE&gt;serverName&lt;/CODE&gt; of that indexer, which may be different from index time.)  So Splunk introduced the &lt;CODE&gt;_bkt&lt;/CODE&gt; field (around the same time as indexer clustering, if I remember correctly.)  And it always returns the same bucket name, even if the hostname changes (because it uses a GUID not a hostname).   This works even if the original host is decommissioned.  (Yes, that still breaks if the index name changes.) &lt;/P&gt;

&lt;P&gt;So the modern equivalent of  (splunk_server, index, _cd) tuple, is now &lt;CODE&gt;(_bkt, _cd)&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;And fortunately, &lt;CODE&gt;_btk&lt;/CODE&gt; is always available and consistent, even if you're not on a cluster.  (Although in that case the GUID just represents the current GUID of the server, not the GUID embedded in the bucket's name.)  The &lt;CODE&gt;_btk&lt;/CODE&gt; field is composition of (1) index name, (2) simple bucket id ( or "local id", a simple incrementing integer), and (3) GUID of the initial bucket creator.   And, as always, &lt;CODE&gt;_cd&lt;/CODE&gt; is a combination of (1) bucket id (integer only), and (2) the internal event number for that bucket.  (If you look under the covers, this is the id that Splunk uses to "delete", aka hide, events.  Notr:  It's unclear to me if the event id (stored in&lt;CODE&gt;_cd&lt;/CODE&gt;) is perstient across a bucket rebuild (if thawed after being frozen, or if passed through exporttool/importtool for some other reasons.)  Again, it's probably not best to rely on this mechanism.)&lt;/P&gt;

&lt;P&gt;But as of Splunk 6.5, you can't search on "_cd" in the base search, and while searching for "_bkt" in the base search works, according to LISPY, it tries to find it as a raw string, which sure doesn't look efficient.  (Also makes me wonder if fields.conf is setup wrong.... another research problem for another day...)&lt;/P&gt;

&lt;P&gt;Bottom line, if this is a feature that you actually need, file an enhancement request.   If you just need something in Splunk with a unique and consistent key, take a look at the KV store--they say it's magic!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9134#M28</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2020-09-29T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9135#M29</link>
      <description>&lt;P&gt;My use case is that I want to select an event from a list and display more details about the event in another panel via drilldown.    Some sort of ID (and ideally, indexed) would make it straightforward.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 02:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9135#M29</guid>
      <dc:creator>tcgerhard</dc:creator>
      <dc:date>2017-08-16T02:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Does each Splunk event have a unique identifier?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9136#M30</link>
      <description>&lt;P&gt;Why didn't you link to the "newer and better answer" so others can benefit as well?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 16:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-each-Splunk-event-have-a-unique-identifier/m-p/9136#M30</guid>
      <dc:creator>dangsecurity</dc:creator>
      <dc:date>2018-01-02T16:20:30Z</dc:date>
    </item>
  </channel>
</rss>

