Splunk Dev

add text to the top-of-screen blue "message" bar using a Python EAI custom endpoint?

Justin_Grant
Contributor

Our app's setup.xml page uses a custom EAI endpoint. I know when we throw an exception from the handleEdit method, the setup page will refuse to save and the exception's message will be displayed in red text at the top of the screen.

But what if we only want to display a "warning" message to users, but without preventing the user from saving settings? Is there a way, in our EAI endpoint, to display a message at the top of the screen without throwing an exception and preventing saving?

Ideally, our message would show up with a yellow background, but the blue-background regular message is OK too.

1 Solution

amrit
Splunk Employee
Splunk Employee

I take it back - this IS possible now. Try it out by posting to /services/messages with the parameters "name" and "value"!

$ splunk _internal call /messages -post:name FOO -post:value "haaay you guyyyyyysss"

View solution in original post

amrit
Splunk Employee
Splunk Employee

I take it back - this IS possible now. Try it out by posting to /services/messages with the parameters "name" and "value"!

$ splunk _internal call /messages -post:name FOO -post:value "haaay you guyyyyyysss"

Justin_Grant
Contributor

Although shoving a message into the top of the screen isn't possible (yet), per Amrit's answer, another option could be to log warnings to a log file (even Splunk's internal log) and then to pull messages out of that log when the app's home page is displayed.

Since the default action after running setup is (or should be!) running the app, the user will see the warning and will be able to re-run setup if needed.

amrit
Splunk Employee
Splunk Employee

Currently this is not possible. Extending the messages endpoint to allow posting from outside of splunkd would be easy to do - I recommend filing an ER for this.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...