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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...