Hi all, I want to analyze several events and the fields in them. Origianally, I use case() to capture one field(Causse) in A_EVENT, and 2 fields(Type, Scenario) in B_event. (index="idx_message" Name="A_EVENT" OR Name="B_Event")
| rename "Data.Cause" as A_cause `comment("belong to A_Event")`
| rename "Data.Type" as B_type `comment("belong to B_Event")`
| rename "Data.Scenario" as B_scenario `comment("belong to B_Event")`
| eval Scenario_name=case(
Name="A_EVENT" AND A_cause=0, "A Cause: X reason",
Name="A_EVENT" AND A_cause=1, "A Cause: Y reason",
Name="B_Event" AND B_type=0, "B Type: a category",
Name="B_Event" AND B_type=1, "B Type: b category",
Name="B_Event" AND B_scenario=0, "B Scenario: description 1",
Name="B_Event" AND B_scenario=1, "B Scenario: description 2",
true(), null)
| where isnotnull(Scenario_name)
| chart limit=0 count by Scenario_name However, while I check the output, the output will be Scenario_name count A Cause: X reason 1 A Cause: Y reason 2 B Type: a category 3 B Type: b category 4 The scenario "B Scenario: description 1" and "B Scenario: description 2" are missing. I found the reason comes from "B Scenario" and "B Type" is used to verdict the same event, if I use case(), I am unable to get any "B Scenario" because all the events will be verdicted as "B Type" already. Is there any way to generate such output? Scenario_name count A Cause: X reason 1 A Cause: Y reason 2 B Type: a category 3 B Type: b category 4 B Scenario: description 1 2 B Scenario: description 2 5 Thanks.
... View more