<?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: How to select one event from a transaction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308175#M92463</link>
    <description>&lt;P&gt;@juanpavergara... do you need only one event for each JSESSIONID with only the latest event(or you need correlated events as well with time of transaction as latest time?)&lt;BR /&gt;
Instead of transaction you should try dedup command, as transaction will be very expensive command specially when you do not need correlated event rather just the latest event. Since latest data is fetched first, dedup will get only the latest match for each JSESSIONID&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month="march" date_mday&amp;gt;="25" date_mday&amp;lt;="26" 
| dedup JSESSIONID
| table _time JSESSIONID _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of _raw you can select specific fields you need.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Apr 2017 19:06:46 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-04-01T19:06:46Z</dc:date>
    <item>
      <title>How to select one event from a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308173#M92461</link>
      <description>&lt;P&gt;I need to group the events (in this case by JSESSIONID) and select the one with the max date &lt;/P&gt;

&lt;P&gt;I have the groups with the following query:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;date_month="march" date_mday&amp;gt;="25" date_mday&amp;lt;="26" | transaction JSESSIONID&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How can I get every transaction only with the newest event?&lt;/P&gt;

&lt;P&gt;TKS!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2017 01:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308173#M92461</guid>
      <dc:creator>juanpavergara</dc:creator>
      <dc:date>2017-04-01T01:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to select one event from a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308174#M92462</link>
      <description>&lt;P&gt;hi&lt;BR /&gt;
can u please try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month="march" date_mday&amp;gt;="25" date_mday&amp;lt;="26" | transaction JSESSIONID | stats latest(JSESSIONID)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;may be you can try any of the option try to fit whichever best&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;first(JSESSIONID)
latest(JSESSIONID)
last(JSESSIONID)
earliest(JSESSIONID) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Apr 2017 18:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308174#M92462</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-04-01T18:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to select one event from a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308175#M92463</link>
      <description>&lt;P&gt;@juanpavergara... do you need only one event for each JSESSIONID with only the latest event(or you need correlated events as well with time of transaction as latest time?)&lt;BR /&gt;
Instead of transaction you should try dedup command, as transaction will be very expensive command specially when you do not need correlated event rather just the latest event. Since latest data is fetched first, dedup will get only the latest match for each JSESSIONID&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month="march" date_mday&amp;gt;="25" date_mday&amp;lt;="26" 
| dedup JSESSIONID
| table _time JSESSIONID _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of _raw you can select specific fields you need.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2017 19:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-one-event-from-a-transaction/m-p/308175#M92463</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-04-01T19:06:46Z</dc:date>
    </item>
  </channel>
</rss>

