Below is a minimal “text + button on the same row” card that Google Chat accepts.
It uses a decoratedText widget (that’s the only widget that lets you keep the button on the same horizontal line) and it contains no fill_available_space property.
Copy/paste the one-liner into Splunk, or use the multi-line version just to read it more easily.
SPL one-liner
| makeresults
| eval payload="{\"text\":\"Alert from Splunk\",\"cards\":[{\"sections\":[{\"widgets\":[{\"decoratedText\":{\"icon\":\"BOOKMARK\",\"text\":\"Alert from Splunk\",\"button\":{\"textButton\":{\"text\":\"View in Splunk\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}}}}]}]}]}"
Replace the URL (and optionally the icon or text) with whatever you need.
Same JSON shown prettified (for clarity only)
{
"text": "Alert from Splunk",
"cards": [
{
"sections": [
{
"widgets": [
{
"decoratedText": {
"icon": "BOOKMARK",
"text": "Alert from Splunk",
"button": {
"textButton": {
"text": "View in Splunk",
"onClick": {
"openLink": {
"url": "https://your-splunk-instance/app/search/search?q=your-search-query"
}
}
}
}
}
}
]
}
]
}
]
}
💡 Why this works
• decoratedText renders its label (“Alert from Splunk”) on the left and the button on the right—exactly what you wanted.
• Google Chat cards ignore unknown properties, so leaving out fill_available_space is perfectly fine.
Send the payload field as the body of your HTTP POST with the header:
{"Content-Type": "application/json"}
…and you’ll get a single-line card with a clickable “View in Splunk” button sitting right next to the text.