Splunk Search

Is it possible to find the storage (logs) used by application/services in a particular index for particular time range?

kcliff
Engager

Is it possible to find the storage (logs) used by application/services in a particular index for particular time range? Or something similar

For ex. 

Query:

((index="digconn-timeser-prod") (kubernetes.container_name="*conn-server*")) |

((index="digconn-timeser-qa") (kubernetes.container_name="*conn-server*")) |

 

This would help identify logging  issues from apps/services side over a period of time

Result:

conn-server-latency 1105 GB last 5 days

conn-server-lag 1505 GB last 5 days

 

 

Labels (2)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

Assuming your data contains a field named "application", it would simply be

((index="digconn-timeser-prod") (kubernetes.container_name="*conn-server*"))
| stats sum(eval(len(_raw))) as logsize by application

If you have to derive application from kubernetes.container_name, do something like the following:

((index="digconn-timeser-prod") (kubernetes.container_name="*conn-server*"))
| rex field=kubernetes.container_name "(?<application>conn-server-\w+)"
| stats sum(eval(len(_raw))) as logsize by application

View solution in original post

Tags (1)

yuanliu
SplunkTrust
SplunkTrust

Assuming your data contains a field named "application", it would simply be

((index="digconn-timeser-prod") (kubernetes.container_name="*conn-server*"))
| stats sum(eval(len(_raw))) as logsize by application

If you have to derive application from kubernetes.container_name, do something like the following:

((index="digconn-timeser-prod") (kubernetes.container_name="*conn-server*"))
| rex field=kubernetes.container_name "(?<application>conn-server-\w+)"
| stats sum(eval(len(_raw))) as logsize by application
Tags (1)
Get Updates on the Splunk Community!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

February 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...