Getting Data In

Evaluating the size (MB/GB) of a specific Source.

zacksoft
Contributor

Every time there is a 'build' performed on our code a new log is created in the tool which is fed to Splunk and in Splunk that comes under as a new 'source'.

Example : If in Splunk there are 6 sources now and a new build is performed on our server then you see the source count will become 7. Every 5 days the build logs are deleted from the server , hence it gets automatically vanished from Splunk sources as well.

The question is, Is it possible to know the size of each source (build log) in MB/Gb (not linecount).

The sources look like,
/bsahare/bsassian/application-data/rambo/xml-data/builds/1
/bsahare/bsassian/application-data/rambo/xml-data/builds/2"
/bsahare/bsassian/application-data/rambo/xml-data/builds/234"
/bsahare/bsassian/application-data/rambo/xml-data/builds/45"
etc...

So the query starts like ,
| index=rambo host=GA20htkram001 source="/bsahare/bsassian/application-data/rambo/xml-data/builds/*"

And I am not a Splunk Administartor so my privileges are limited as a User.

Tags (1)
0 Karma

DalJeanis
Legend

Probably not, unless the size of the build is fed into splunk in that same record, or some other way.

On the other hand, if splunk is receiving the entire build code, then YES, approximately. Try running something like this, and see if the answer (mySize) makes any sense as being the size of a build in bytes.

   index=rambo host=GA20htkram001 source="/bsahare/bsassian/application-data/rambo/xml-data/builds/*"
  | eval mySize=len(_raw)
  | stats sum(mySize) as mySize by source
0 Karma

zacksoft
Contributor

Thanks for your assistance.
Just wanted to confirm again, if we indeed get the results in "bytes"?
IF yes, then that's totally awesome. We can get it converted to GB or MB and make it work?

0 Karma

DalJeanis
Legend

FYI, the above can also be accomplished with tstats, and that's the way to go in the long run if the data is there.

0 Karma

zacksoft
Contributor

could you please give an example with sample query on how to do the same with tstats

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...