Splunk Search

How do I edit my search to divide an amount by 100 per month and display this in a timechart?

markgandolfo
Engager

Hi,

I'm trying to group all payments "amount" by month. The challenge is they're in cents, and I would prefer dollars.
I have one condition which is search "params.type"="charge.succeeded". From there I'm trying to collect the params.data.object.amount which is the amount charged in cents.

I've tried a number of different ways to divide the amount, but it seems I can either divide the amount by 100, to represent dollars, or I can timechart it, but I can't seem to do both. Below is a mess of where I've ended.

host=production | spath "params.type" | search "params.type"="charge.succeeded"| spath "params.data.object.amount" | stats sum("params.data.object.amount") as total | timechart span=1mon

Could anyone help point me in the right direction?

0 Karma
1 Solution

sundareshr
Legend

Try this

your search and criteria here | spath path="params.data.object.amount" output=amt | eval amt=amt/100 |timechart span=1mon sum(amt) as total

View solution in original post

0 Karma

sundareshr
Legend

Try this

your search and criteria here | spath path="params.data.object.amount" output=amt | eval amt=amt/100 |timechart span=1mon sum(amt) as total
0 Karma

markgandolfo
Engager

Thank you very much!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...