Splunk Search

What is the average of occurrence of string in the log files?

tankhanandita
Explorer

Hi,

I have a log file in which I have two things

functionality and different repositories which use this functionality . I want to calculate average of occurrence of this functionality over each repository. 

The name of the functionality is string

Repo 1 A,A,A

Repo 2 A,A,A

Repo 3 A,A,A,A

 

The output should be

Name of Repo Avg for functionality A

1                               0.3

2                                0.3

3                                0.4

 

 

Labels (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have a field called string holding the string you want counting and a field called repo holding the repository name, try something like this

| stats count by repo string
| eventstats sum(count) as total by string
| eval average=round(count/total,2)
| xyseries repo string average

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have a field called string holding the string you want counting and a field called repo holding the repository name, try something like this

| stats count by repo string
| eventstats sum(count) as total by string
| eval average=round(count/total,2)
| xyseries repo string average
0 Karma

tankhanandita
Explorer

Hi,

 

Thank you so much! This worked

0 Karma
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...