Splunk Search

How to run two function in single query?

geetanjali
Path Finder

hi,

I want to display sum of latest values in "SingleValue" module. what would be my query?
i am using :-

<module name="HiddenSearch" layoutPanel="panel_row2_col1" autoRun="True">
    <param name="search">index="test" sourcetype="power_usage" | chart sum(Power_consumption) as Total(W)  </param>
          <module name="SingleValue">
            <param name="beforeLabel">現在の消費電力: </param>
            <param name="format">results</param>
            <param name="afterLabel">(W)</param>
          </module>
    </module> 

This module will return over all sum of power consumption. I want to sum only latest values.

like : sum(first(Power_consumption))

How could i update my query?

Please help.

thanks in advance

Tags (1)
0 Karma

hjwang
Contributor

The last function just only return last seen value of your specified field. Or you wanna sum(Power_consumption) during the specified time period, if so, you can add earliest=-1h latest=now in your search string.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...