<?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: Comparing different events timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418060#M120248</link>
    <description>&lt;P&gt;In that case, you can calculate your common_key like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch | eval firsrCalc=(thats returns null for second event) | eval secondCalc=(that returns null for the first event) | eval common_key=coalesce(firstCalc, secondCalc) |...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 May 2018 15:25:52 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-05-25T15:25:52Z</dc:date>
    <item>
      <title>Comparing different events timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418057#M120245</link>
      <description>&lt;P&gt;Hi! &lt;/P&gt;

&lt;P&gt;I have 2 events to compare, one always comes first and the second is the result of, I want to present the time it took to get the result.&lt;/P&gt;

&lt;P&gt;In order to so that, every couple events as a common key(same key to the first and second), not every first event has a pair.&lt;BR /&gt;
so right now i have this table: &lt;/P&gt;

&lt;P&gt;First   ``` second&lt;/P&gt;

&lt;P&gt;1&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;``` ```2&lt;BR /&gt;
&lt;/CODE&gt; &lt;CODE&gt;&lt;/CODE&gt;1&lt;BR /&gt;
3&lt;BR /&gt;
4&lt;BR /&gt;
```````````5&lt;BR /&gt;
5&lt;/P&gt;

&lt;P&gt;(The ` is to present the columns - it's an empty cell).&lt;/P&gt;

&lt;P&gt;I want to filter just the events that has a same key in the other column (1,5 in this example) and I couldn't do it so far.&lt;BR /&gt;
Thank u in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 20:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418057#M120245</guid>
      <dc:creator>pazReshef</dc:creator>
      <dc:date>2018-05-24T20:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing different events timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418058#M120246</link>
      <description>&lt;P&gt;Whats your search to get the events of both type? Also, can you share some sample data for both type of events?&lt;BR /&gt;
 I believe something like this would work but can't say for sure without seeing your current search/data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search to select both type of events, with a field called common_key
| stats max(_time) as Result min(_time) as Request by common_key
| where Result!=Request | rename COMMENT as "This means there are two events for the common_key"
| eval Duration=Result-Request | convert ctime(Result) ctime(Request)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 21:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418058#M120246</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-24T21:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing different events timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418059#M120247</link>
      <description>&lt;P&gt;Unfortunately, I don't have the key that easely, I calculate him from the url of the event, and for every event the caculation is different, it meens it looks something like that: &lt;BR /&gt;
baseSearch | eval firsrCalc (thats returns null for second event) | eval secondCalc (that returns null for the first event) | table firstCalc, secondCalc.&lt;/P&gt;

&lt;P&gt;I tried to name same eval to the calculations but it only took the second calc and "as" is not allowed there.&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 09:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418059#M120247</guid>
      <dc:creator>pazReshef</dc:creator>
      <dc:date>2018-05-25T09:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing different events timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418060#M120248</link>
      <description>&lt;P&gt;In that case, you can calculate your common_key like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch | eval firsrCalc=(thats returns null for second event) | eval secondCalc=(that returns null for the first event) | eval common_key=coalesce(firstCalc, secondCalc) |...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 May 2018 15:25:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-different-events-timestamp/m-p/418060#M120248</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-25T15:25:52Z</dc:date>
    </item>
  </channel>
</rss>

