Splunk Search

Splunk search

s_unny
Loves-to-Learn Lots

HI, i am new to Splunk and trying to gain hands-on experience, i am facing trouble to search the data based on this query "Which age group performed the most fraudulent activities and to what merchant?" can any one help me to figure out the soulution . 

Labels (2)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

1. The question is a bit ambiguous.

2. We don't know your data. Post some (possibly anonymized but I don't think it's necessary in this case).

3. What have you tried so far and how the results differ from what you expected?

 

0 Karma

s_unny
Loves-to-Learn Lots

source="sampleprepared_data.csv" fraud="1" | stats count values(fraud) by age,merchant | sort - count

I have tried this query to aggregate the data by age and merchant and sorted the data in descending order, i feel  like something is missing, i can't figure out what

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Ok. "values(fraud)" will always be 1 because you're only searching for the events which have fraud=1.

As I said before, the question is a bit ambiguous. If you do your (without the values() aggregation which makes no sense.

| stats count by merchant age

it will indeed count your frauds splitting it for each age-merchant pair. But the question is whether you want this - the biggest merchant-age pair or if you want two separate stats one by age and one by merchant and want to find two separate maximum values - one for each stats. The former you already have. The latter you can get by doing two separate searches - one with count by age and onewith count by merchant. Getting both values from a single search will be more complicated.

0 Karma

s_unny
Loves-to-Learn Lots

I want to print, the age group with the highest fraud activity by a merchant, I found the solution for it, through the query that I mentioned earlier, it appears that the age group 19-35 performed more fraud activities. 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...