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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...