Splunk Search

75th percentile caluclation

ertzsmith
New Member

I need to calculate 75th percentile by minutes

Time: 11:12 magnitude 3.4
Time: 11:12 magnitude 4.4
Time: 11:12 magnitude 3.9
Time: 11:15 magnitude 3.8
Time: 11:15 magnitude 2.4
Time: 11:15 magnitude 3.1
Time: 12:10 magnitude 3.6
Time: 12:11 magnitude 3.5
Time: 12:11 magnitude 4.4
Time: 12:11 magnitude 3.9

Tags (1)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Try this:

base search | timechart span=1m p75(magnitude)

That's assuming your events are timestamped correctly and you have the magnitude field extracted.

martin_mueller
SplunkTrust
SplunkTrust

That looks for a number with optional decimal point.

0 Karma

ertzsmith
New Member

It worked on above example file
can you please explain what does expression in rex "\d+(.\d+) " is doing

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Try this rex:

rex "magnitude (?<magnitude>\d+(\.\d+)?)"

Verify that the field is extracted before adding the timechart.

0 Karma

ertzsmith
New Member

thanks for quick reply, i tried below search but no good.

base search | rex field=_raw "magnitude (?) |" | timechart span=1m p75(response)

I get blank values in response column

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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...