<?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 How to retrieve specific timestamps for specific values ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574844#M200318</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am currently developing a use case in which I have the below info:&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" width="534px" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;Username&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;User Status&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;User Code&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;Time of Event per User Status update&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user A&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;xxxxx&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:22:15&lt;/P&gt;&lt;P&gt;2021-11-13 23:40:09&lt;/P&gt;&lt;P&gt;2021-11-13 23:45:09&lt;/P&gt;&lt;P&gt;2021-11-13 23:50:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user B&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;yyyyy&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:40:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:50:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user A&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;ggggg&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:50:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:55:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:58:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like&amp;nbsp; to find for each user the time difference between the timestamps of the first occurrence of status 0 and then the first occurrence of status 1.&lt;/P&gt;&lt;P&gt;So based on the above table, I would like to extract the timestamp of 2021-11-13 22:22:15 for User Status 0 and the timestamp 2021-11-13 23:45:09 for User Status 1 for the user A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my search query so far looks like it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| my index&lt;BR /&gt;| sort UserStatus&lt;/P&gt;&lt;P&gt;| transaction mvlist=true Username UserStatus | search eventcount &amp;gt;1 | UserStatus =0 and UserStatus=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be much appreciated! Thanks&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 14 Nov 2021 13:30:13 GMT</pubDate>
    <dc:creator>malice</dc:creator>
    <dc:date>2021-11-14T13:30:13Z</dc:date>
    <item>
      <title>How to retrieve specific timestamps for specific values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574844#M200318</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am currently developing a use case in which I have the below info:&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" width="534px" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;Username&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;User Status&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;User Code&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;Time of Event per User Status update&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user A&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;xxxxx&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:22:15&lt;/P&gt;&lt;P&gt;2021-11-13 23:40:09&lt;/P&gt;&lt;P&gt;2021-11-13 23:45:09&lt;/P&gt;&lt;P&gt;2021-11-13 23:50:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user B&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;yyyyy&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:40:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:50:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="85.1562px"&gt;&lt;P&gt;user A&lt;/P&gt;&lt;/TD&gt;&lt;TD width="91.375px"&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="82.3281px"&gt;&lt;P&gt;ggggg&lt;/P&gt;&lt;/TD&gt;&lt;TD width="274.141px"&gt;&lt;P&gt;2021-11-13 22:50:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:55:09&lt;/P&gt;&lt;P&gt;2021-11-13 22:58:09&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like&amp;nbsp; to find for each user the time difference between the timestamps of the first occurrence of status 0 and then the first occurrence of status 1.&lt;/P&gt;&lt;P&gt;So based on the above table, I would like to extract the timestamp of 2021-11-13 22:22:15 for User Status 0 and the timestamp 2021-11-13 23:45:09 for User Status 1 for the user A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my search query so far looks like it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| my index&lt;BR /&gt;| sort UserStatus&lt;/P&gt;&lt;P&gt;| transaction mvlist=true Username UserStatus | search eventcount &amp;gt;1 | UserStatus =0 and UserStatus=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be much appreciated! Thanks&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 14 Nov 2021 13:30:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574844#M200318</guid>
      <dc:creator>malice</dc:creator>
      <dc:date>2021-11-14T13:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve specific timestamps for specific values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574845#M200319</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats earliest(_time) as time by Username 'User Status'
| eval time0=if('User Status'=0,time,null())
| eval time1=if('User Status'=1,time,null())
| stats values(time0) as time0 values(time1) as time1 by Username
| eval diff=time1-time0&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 14 Nov 2021 13:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574845#M200319</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-14T13:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve specific timestamps for specific values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574847#M200320</link>
      <description>&lt;P&gt;What is your original data? Because this already looks like some calculated stats table.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Nov 2021 18:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-retrieve-specific-timestamps-for-specific-values/m-p/574847#M200320</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-11-14T18:00:04Z</dc:date>
    </item>
  </channel>
</rss>

