Splunk Search

How do I re-insert newlines into transaction raw message for dashboard?

stucky101
Engager

Gurus

I am working on a Studio Dash and I would like to add the output of a transaction the way it is usually shown in the search gui for debugging purposes so I can easily see if the transaction is correct.

Turns out the only option I seem to have is a table but here I only get the raw msg. That's ugly and unreadable, of course, since the newlines are merged into one. 

Is there a way to do this within a dashboard and make the message look just like in the search gui ? Perhaps I could re-insert the newlines ?

 

Thx

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @stucky101,

why don't you try to avoid transaction command to have the result you want?

in other words: if you have to group events by a key (called "your_key") and you want to display three fields, instead this transaction command:

<your_search>
| transaction your_key
| table _time your_key field1 field2 field3

you could run:

<your_search>
| stats 
   earliest(_time) AS _time 
   values(field1) AS field1
   values(field2) AS field2
   values(field3) AS field3
   BY your_key 

Ciao.

Giuseppe

0 Karma

stucky101
Engager

Giuseppe

I have many transactions and some are more complex including startswith. I'm trying to extract an Infoblox zone transfer and that is proving challenging but transactions have helped a lot.

I also do  the tr by more than one field. F.e. here I have extracted the zone name and then I do this"

query | rex for zone | transaction endswith="Transfer completed:" by host,zone

Besides, Im sure there are times when you definitely need a transaction and I was just wondering if you can re-format those back into the same style that the searchapp displays them.

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!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...