Splunk IT Service Intelligence

I had a issue with Splunk server Availability Query. Can anyone check and correct me?

Rajasekhar90
New Member

Hi All,

I had a issue with Splunk server Availability Query. Can anyone check and correct me?

index=itsi_summary kpi="Splunk Agent Availability" NOT "entity_title=service_aggregate"
| eval test = replace(alert_value, "N.A", "1")
| stats sum(test) as off dc(date_mday) as day by entity_title
| eventstats max(day) as max_day
| eval max = max_day*1440
| eval server_off = off*5
| eval percent_off = (server_off / max) * 100
| eval percent_on = 100 - percent_off
| table entity_title, percent* day server_off
| rename entity_title as Host percent_off as "Unavailability Percentage" percent_on as "Availability Percentage" day as "Number of running days" server_off as "Server Unavailable in Minutes"

Thanks in Advance!!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What results are you getting and what are the expected results?

---
If this reply helps you, Karma would be appreciated.
0 Karma

rajasekharsplun
Engager

I didn't find the results. I want to see the results till date. Any changes need to done in query?

Regards,
Raj

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's difficult to determine the correctness of a query without knowing the data being searched as well as the desired output.

There are, however, some problems with the query. Some may be the result of errors entering the query into the question.

The table command makes only 4 fields available, but the following rename command attempts to rename two fields that no longer exist (percent_off, percent_on).

The base query is searching for the string "entity_title=service_aggregate". Perhaps it intends to search for the field entity_title containing the value "service_aggregate" (entity_title="service_aggregate").

The calculation of percent_off is missing a * character.

The field server_off claims to be in minutes, but is multiplied by 5 for no apparent reason.

Please verify the alert_value field contains "N.A" and not "N/A".

---
If this reply helps you, Karma would be appreciated.
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 ...