Not sure if I am interpreting your question correctly but I gave it a shot. So given that the are many different fieldnames with dot notation. You are trying to get a final table of som...
See more...
Not sure if I am interpreting your question correctly but I gave it a shot. So given that the are many different fieldnames with dot notation. You are trying to get a final table of something like this? I was able to achieve this by utilizing a foreach loop | makeresults
| eval
"tmp.exe"="value1"
| append
[
| makeresults
| eval
"noop.spl"="value2"
]
| append
[
| makeresults
| eval
"tmp.spl"="value3"
]
| append
[
| makeresults
| eval
"foo.exe"="value4"
]
| append
[
| makeresults
| eval
"tmp.tgz"="value5"
]
| append
[
| makeresults
| eval
"foo.tgz"="value6",
"tmp.exe"="value7"
]
``` Gather unique fieldnames as values of a new field ```
| foreach *.*
[
| eval
existing_fieldname=if(
isnotnull('<<FIELD>>'),
mvappend(
'existing_fieldname',
"<<FIELD>>"
),
'existing_fieldname'
)
]
``` Parse out prefix and suffix of the new field ```
| eval
prefix=case(
isnull(existing_fieldname), null(),
mvcount(existing_fieldname)==1, mvindex(split(existing_fieldname, "."), 0),
mvcount(existing_fieldname)>1, mvmap(existing_fieldname, mvindex(split(existing_fieldname, "."), 0))
),
suffix=case(
isnull(existing_fieldname), null(),
mvcount(existing_fieldname)==1, mvindex(split(existing_fieldname, "."), 1),
mvcount(existing_fieldname)>1, mvmap(existing_fieldname, mvindex(split(existing_fieldname, "."), 1))
)
``` Use chart function to display unique combos of prefix/suffix from inherited fieldnames ```
| chart limit=50
count as count
over prefix
by suffix
``` Replace numbers in the table with "X" to signify that the prefix/suffix combo was found in the data ```
| foreach *
[
| eval
<<FIELD>>=if(
NOT "<<FIELD>>"=="prefix",
if(
'<<FIELD>>'>0,
"X",
null()
),
'<<FIELD>>'
)
]