Splunk Enterprise

Work with fieldnames that contains {}. +PRTG

maaneeel
Explorer

Hi,

I'm using the PRTG app to get logs from this monitoring tool and build clean reports about our servers health.

The API is returning a JSON and the automatic field extraction gets fields like sensors{}.sensor.

How could I build a query referencing to this fields? If I try something like this fails:

index=prtg "sensors{}.sensor"=Ping

Thanks

Labels (3)
0 Karma

maaneeel
Explorer

I also tried use eval and filter by the new result without success

 

eval.png

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It looks like sensors{}.sensor is a multi-value field - try extracting the collection (spath) and separate each element into different events (mvexpand), then extract the fields you are interested in (spath again).

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Hi
as your event is json, you should try spath with it.
r. Ismo
0 Karma

maaneeel
Explorer

Thanks

 

I didn't know spath command, but after try it I have the same problem with the new field...

spath.png

Any idea?

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=prtg
| spath output=sensors path=sensors{}
| mvexpand sensors
| search Ping
| spath input=sensors
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try with single quotes not double

index=prtg 'sensors{}.sensor'=Ping

0 Karma

maaneeel
Explorer

splunk_query.png

Hello again, It's not working,

Thanks for your help

@isoutamo 

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Exactly that way. Usually single quote means field and double means value (of field).
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...