Splunk Search

Column Merging, how to?

bilgin
New Member

The below search script successfully charts one table with two separate set of search results each has the individual columns. Trouble is, we need the column as merged into one column. Note that not each event type has a result, thus some of the events will have null entry.
Does anyone can light my way?
Thanks.
Here is the search script I am using.

eventType="event1" 
| chart count(eval(time<4000)) as event1LessThan4Sec, count as TotalCount1 by siteID
| rename siteID as "ID for 1"
| eval SLAsMet1=event1LessThan4Sec/TotalCount1
| appendcols [ search eventType="event2" 
    | chart count(eval(time<2000)) as event2LessThan2Sec, count as TotalCount2 by siteID
    | rename siteID as "ID for 2"
    | eval SLAsMet2=event2LessThan2Sec/TotalCount2
]
Tags (1)
0 Karma

southeringtonp
Motivator

So you just want one field containing the value of either "ID for 1" or "ID for 2", with the assumption that only one of them will contain a value ?

If so, you can always use something like:

| eval siteID=coalesce("ID for 1", "ID for 2")
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 ...