<?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 query only stats using Spunk Java SDK in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-query-only-stats-using-Spunk-Java-SDK/m-p/603688#M10683</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247281"&gt;@tuandinh&lt;/a&gt;&amp;nbsp;- You need to use stats command instead of eventstats.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`myapp` "Message of interest" | stats min(metricOfInterest) as ft_min max(metricOfInterest) as ft_max avg(metricOfInterest) as ft_avg stdev(metricOfInterest) as ft_stdev | fields ft_min, ft_max, ft_avg, ft_stdev&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 03:56:04 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2022-06-29T03:56:04Z</dc:date>
    <item>
      <title>How to query only stats using Spunk Java SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-query-only-stats-using-Spunk-Java-SDK/m-p/603683#M10682</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I'm using Splunk Java SDK in my application, this version to be exact:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;implementation group: 'com.splunk', name: 'splunk', version: '1.6.5.0'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the app, I'm trying to get some stats on a metric from Splunk logs.&amp;nbsp;&lt;BR /&gt;Here's the native search command in Splunk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`myapp` "Message of interest" | eventstats min(metricOfInterest) as ft_min max(metricOfInterest) as ft_max avg(metricOfInterest) as ft_avg stdev(metricOfInterest) as ft_stdev | fields ft_min, ft_max, ft_avg, ft_stdev&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this query would return a bunch of events and 4 additional fields&amp;nbsp; ft_min, ft_max, ft_avg, ft_stdev for each event. For the sake of the conversation, let's say there's 200 events matched the search.&lt;BR /&gt;&lt;BR /&gt;In my app, the `SplunkResponse` contains 200 Map&amp;lt;String, Object&amp;gt;, each map represents an event.&lt;/P&gt;&lt;P&gt;What I want is a single entry that contains only `ft_min, ft_max, ft_avg, ft_stdev`. Right now, I can extract it from an event (among those 200), &amp;nbsp;but having all events is too verbose and unnecessary. &amp;nbsp;Is this achievable by twisting the query or using a particular SDK API ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tuan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 01:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-query-only-stats-using-Spunk-Java-SDK/m-p/603683#M10682</guid>
      <dc:creator>tuandinh</dc:creator>
      <dc:date>2022-06-29T01:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to query only stats using Spunk Java SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-query-only-stats-using-Spunk-Java-SDK/m-p/603688#M10683</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247281"&gt;@tuandinh&lt;/a&gt;&amp;nbsp;- You need to use stats command instead of eventstats.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`myapp` "Message of interest" | stats min(metricOfInterest) as ft_min max(metricOfInterest) as ft_max avg(metricOfInterest) as ft_avg stdev(metricOfInterest) as ft_stdev | fields ft_min, ft_max, ft_avg, ft_stdev&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 03:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-query-only-stats-using-Spunk-Java-SDK/m-p/603688#M10683</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-29T03:56:04Z</dc:date>
    </item>
  </channel>
</rss>

