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)
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...