Splunk Search

How to format results and populate a dashboard dropdown filter with mcatalog?

winknotes
Path Finder

I'm trying to populate a dropdown filter with a mcatalog search to allow a user to select from a list of dimensions. The search works but the results are returned as a long string without line breaks between the items returned. I've been looking and looking for a solution but can't find anything. So I'm reaching out for help.

|mcatalog values(array_name) AS array_name WHERE index="my_index" 

I've tried many many options (eval, rex, table, and so on) to get the results formatted as a list that shows up properly in the dropdown. Thanks in advance.

0 Karma
1 Solution

jacobpevans
Motivator

mcatalog values(xyz) returns the list of all distinct values of the specified field as a multivalue entry (See here)

So, throw in a mvexpand to expand it out, e.g.

| mvexpand array_name

See here for more information regarding Splunk multivalue eval functions, specifically mvexpand

Alternatively, mcatalog has a BY parameter that may be useful to you.

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.

View solution in original post

jacobpevans
Motivator

mcatalog values(xyz) returns the list of all distinct values of the specified field as a multivalue entry (See here)

So, throw in a mvexpand to expand it out, e.g.

| mvexpand array_name

See here for more information regarding Splunk multivalue eval functions, specifically mvexpand

Alternatively, mcatalog has a BY parameter that may be useful to you.

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.

winknotes
Path Finder

Brilliant!! So much to learn...so little time.

0 Karma

jacobpevans
Motivator

You're welcome. Don't forget to mark this as the accepted answer if this solved your problem. If not, feel free to reply.

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...