Splunk Search

How can I sum the numeric value in one field after doing field extraction?

quangva
New Member

My event like this:

_time,ProductA,2,"318"
_time,ProductA,5,"318"
_time,ProductA,3,"318"

Extracted fields are:

Time, Product, Qty, Price

I need to sum Qty field as Total for this example 10

0 Karma
1 Solution

vnravikumar
Champion

Hi

Try

your query..|stats sum(Qty) as Total

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Try

your query..|stats sum(Qty) as Total
0 Karma

quangva
New Member

Yeah, it get right result. But Price is not if we do the same. Do we need to convert string to numberic?

0 Karma

vnravikumar
Champion

Its in doble quotes considered as string.

0 Karma
Get Updates on the Splunk Community!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...