Splunk Enterprise Security

Splunk Add-on - multi select values in an alert action

shacharh
New Member

Hi,

I'm working on an add-on for Splunk. I added an alert action, and I'm adding some fields to it.
How can I add a dynamic multi-select field? The use case - I query Splunk, display the values, and allow the user to select some or all of them. The closest thing I've found is Splunk's splunk-search-dropdown, but it is only for single select.

Thanks,
Shachar

0 Karma

lakshman239
Influencer

would it be of any issue, if you concatenate the multiple values selected by user to something like "value1, value2,value3" and send it your alert actions, where you can act based on value1, 2 3?

0 Karma

shacharh
New Member

@lakshman239 If you mean that the user would be able to select multiple values, and I'll get them as "value1, value2,value3" in the backend, yes, that would work for me.

0 Karma

lakshman239
Influencer

when user selects multiple values, save them to a field in an index (which has concatenated values) and give this in your alert action [ one of the field].

0 Karma

shacharh
New Member

But I need to dynamically create those fields from a search results. Is this possible?

0 Karma

lakshman239
Influencer

Yes, thats possible. As you know what fields are possible (by dynamic selection), you can save them to a field and inside the modalert*.py, you can parse them and extract them to your needs.

0 Karma

shacharh
New Member

@lakshman239 but how can the user choose the fields? (he needs to choose some or all of them)

0 Karma

lakshman239
Influencer

As part of your add-on, I assume you are building a config page and alert UI (where you run a search and show fields in multi-select). The users select them and you save them to another field or index, which is passed as alert actions (pls check alert_actions.conf) and inside your modalert*.py you can then process them. Hope I am thinking along your requirements. If you are using Add-on builder, it will be easy.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...