Dashboards & Visualizations

product of static functions in timechart

mak_sym
New Member

Hi!

I need to calculate cost of rest calls in my application, and group it by service.
In other words I need to build F(_time, count_of_calls * avg_call_time) by service, something like this:

source="_mySource" "[PERFEVENT]" AND("T=SERVICE_CALL")  | rex field=_raw "URL=/(?<service>\w+)/.*\|EXEC" | rex field=_raw "EXEC=(?<exec_time>.+)\|CNT" | timechart usenull=f useother=f limit=0 span=10m avg(exec_time)*count() by service

Of course

avg(exec_time)*count()

does not work, but that is exactly what I need. I tried different approaches but nothing works. Has anybody solved the similar problem? Or it in not possible to build query like this?

Tags (1)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Why not calculate the actual total execution time?

...| timechart limit=0 useother=f usenull=f span=10m avg(exec_time) sum(exec_time) by service

/K

View solution in original post

0 Karma

kristian_kolb
Ultra Champion

Why not calculate the actual total execution time?

...| timechart limit=0 useother=f usenull=f span=10m avg(exec_time) sum(exec_time) by service

/K

0 Karma

mak_sym
New Member

yes, it makes sense, thank you.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...