SPLK-5001 · Question #72
After discovering some events that were missed in an initial investigation, an analyst determines this is because some events have an empty src field. Instead, the required data is often captured in…
The correct answer is A. | eval src = coalesce(src,machine_name). Option A is correct because coalesce(src, machine_name) returns the first non-null, non-empty value from its arguments - so if src is empty, it falls back to machine_name, giving the analyst a unified field that captures events from either source without modifying the…
Question
After discovering some events that were missed in an initial investigation, an analyst determines this is because some events have an empty src field. Instead, the required data is often captured in another field called machine_name. What SPL could they use to find all relevant events across either field until the field extraction is fixed?
Options
- A| eval src = coalesce(src,machine_name)
- B| eval src = src + machine_name
- C| eval src = src . machine_name
- D| eval src = tostring(machine_name)
How the community answered
(44 responses)- A75% (33)
- B9% (4)
- C2% (1)
- D14% (6)
Explanation
Option A is correct because coalesce(src, machine_name) returns the first non-null, non-empty value from its arguments - so if src is empty, it falls back to machine_name, giving the analyst a unified field that captures events from either source without modifying the underlying data pipeline.
Option B (src + machine_name) uses arithmetic addition, which is meaningless for string fields and would produce null or unexpected results. Option C (src . machine_name) is string concatenation (using the . operator), which would smash both values together into one string rather than choosing one over the other - not what's needed here. Option D (tostring(machine_name)) simply converts machine_name to a string and assigns it to src, completely ignoring any cases where src already has a valid value.
Memory tip: Think of coalesce as "coalesce = choose the first non-empty one" - it covers the alternative, just like a backup power source kicking in when the primary fails.
Topics
Community Discussion
No community discussion yet for this question.