<?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: Calculating time difference between two fields of the same name in two sourcetypes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93910#M19535</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a stupid question for followup &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; !&lt;/P&gt;

&lt;P&gt;What if the field was named accountNumber in alphalog and accountId in betalog, how would the searches that you suggested change (obviously a join is involved)&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2013 18:31:54 GMT</pubDate>
    <dc:creator>asarolkar</dc:creator>
    <dc:date>2013-01-21T18:31:54Z</dc:date>
    <item>
      <title>Calculating time difference between two fields of the same name in two sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93908#M19533</link>
      <description>&lt;P&gt;All,&lt;/P&gt;

&lt;P&gt;I have two logs with &lt;CODE&gt;sourcetype="alphalog"&lt;/CODE&gt; and &lt;CODE&gt;sourcetype="betalog"&lt;/CODE&gt; with the generic timestamp _time present.&lt;/P&gt;

&lt;P&gt;I am joining them on a field called &lt;CODE&gt;accountId&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;What I want to do is to be able to find the difference between the &lt;CODE&gt;"_time"&lt;/CODE&gt; values if possible ?&lt;/P&gt;

&lt;P&gt;How do I find the time difference (epoch time is fine too) between two _time values in two difference log files ?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 17:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93908#M19533</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-01-21T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating time difference between two fields of the same name in two sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93909#M19534</link>
      <description>&lt;P&gt;Although it might not be the fastest, you can use "transaction".&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="alphalog" OR sourcetype="betalog" | transaction accountId maxspan=10m| timechart duration by accountId&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Transaction calculates the duration in seconds for each transaction.&lt;/P&gt;

&lt;P&gt;You can also do a stats and eval:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="alphalog" OR sourcetype="betalog" | stats latest(_time) as lt earliest(_time) as et by accountId| eval duration = lt - et| table duration accountID&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 17:46:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93909#M19534</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-01-21T17:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating time difference between two fields of the same name in two sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93910#M19535</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a stupid question for followup &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; !&lt;/P&gt;

&lt;P&gt;What if the field was named accountNumber in alphalog and accountId in betalog, how would the searches that you suggested change (obviously a join is involved)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 18:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93910#M19535</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-01-21T18:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating time difference between two fields of the same name in two sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93911#M19536</link>
      <description>&lt;P&gt;It's all in manuals &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Let's say you have a set of events where the IP address is extracted to either clientip or ipaddress. This example defines a new field called ip, that takes the value of either clientip or ipaddress, depending on which is not NULL (exists in that event):&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | eval ip=coalesce(clientip,ipaddress)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 19:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-time-difference-between-two-fields-of-the-same-name/m-p/93911#M19536</guid>
      <dc:creator>kallu</dc:creator>
      <dc:date>2013-01-21T19:23:27Z</dc:date>
    </item>
  </channel>
</rss>

