- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RSS_STT
Explorer
08-29-2024
07:52 AM
I want to create one static field by looking status value = Issue
host | m_nname | status |
A | cpu | Ok |
B | disk | Ok |
C | memory | Issue |
D | netwok | Ok |
E | storage | Issue |
Issue found in status column few field heath created with Bad value.
Like below.
host | m_nname | status | Health |
A | cpu | Ok | Bad |
B | disk | Ok | Bad |
C | memory | Issue | Bad |
D | netwok | Ok | Bad |
E | storage | Issue | Bad |
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
09-02-2024
03:11 AM
| eventstats values(eval(if(status="Issue","Bad",null()))) as Health
| fillnull value="Ok" Health
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PickleRick

SplunkTrust
08-29-2024
12:59 PM
It's not clear how the health field is calculated. One way is what @ITWhisperer showed but it won't match your mockup results - you have health=bad all acros the board.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
08-29-2024
11:58 AM
Are you saying that you want a health field that has "Bad" in for all the events if any of the events have status="Issue"?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RSS_STT
Explorer
08-29-2024
11:05 PM
Yes, Your understanding is correct.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
08-29-2024
11:53 PM
| eventstats values(eval(if(status="Issue","Bad",null()))) as Health
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RSS_STT
Explorer
09-02-2024
02:41 AM
It's missing the fields value if all Ok.
I need Health field to be populated with Ok if all status field have all Ok value.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
09-02-2024
03:11 AM
| eventstats values(eval(if(status="Issue","Bad",null()))) as Health
| fillnull value="Ok" Health
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
08-29-2024
11:53 AM
Use the eval command to create a field.
| eval Health = if(status="Issue", "Bad", "Ok")
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
