Splunk Search

Search results between a certain number when result has a letter before number e.g C1000

Callum_f
Explorer

Hey Everyone, 

I am trying to search for a field to see how much a customer is spending but there is a letter in front of it.

e.g. "cost" : "C1000" showing they spent $1000. 

So for example I want to search when the user spends between C1000 and C20000. 

is there a way to remove the C and search the numbers of the result?

this is what I have so far

index="silverprod" source=*finance* ("Lambda" "Payload") NOT (lambda-warmer) *topup*

 

Labels (2)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Callum_f 

Can you please try this?

YOUR_SEARCH
| eval cost=replace(cost,"C","") | where cost >500 AND cost < 1500

 

My Sample Search :

|makeresults count=100 | eval a=100| accum a | eval cost="C".a
| rename comment as "Upto Now is sample data only" 
| table cost
| eval cost=replace(cost,"C","") | where cost >500 AND cost < 1500

 

Thanks
KV
▄︻̷̿┻̿═━一   ?

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.


 

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...