Splunk Search

How to write a search to graph average time by site specific location using my sample data?

XtC
Engager

I'm trying to graph the average time of an event:

July 18, 2016 10:02 -> INFO -> Done with sync of project-high-med-2016-spf-1-0_amss_standard_oem_milestone to eurdc of 272 MB in 20.29167366027832 seconds

July 18, 2016 08:16 -> INFO -> Done with sync of shenzhen-hipad-telecommunication-technology-co-ltd/msm8909-la-1-1_amss_oem_milestone-major to tw of 24 MB in 14.404675483703613 seconds

So I want to display the results of average time per region:
eurdc= x seconds
tw= x seconds

Any suggestions?

0 Karma

Raschko
Communicator

Try this:

yoursearch | rex "to\s(?<loghost>\w+)\sof\s\d+\sMB\sin\s(?<seconds>\d+\.\d+)\sseconds" | stats avg(seconds) by loghost

XtC
Engager

Seems to be working, can you explain a little bit the way to form the expression?

0 Karma

Raschko
Communicator

The rex command is just extracting the needed fields loghost and seconds from the event logs.

Afterwards the stats command is calculating the needed average (avg) of seconds by loghost.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...