Getting Data In

Why do my inline eval statements work with spath, but do not as calculated fields in props.conf?

jwalthour
Communicator

Why does this work:

index=dns sourcetype=stream:dns
| eval host_addresses=spath(_raw,"host_addr{}")
| eval hostnames=spath(_raw,”hostname{}”)
| eval message_types=spath(_raw,"message_type{}")
| eval names=spath(_raw,"name{}")
| eval queries=spath(_raw,"query{}")
| eval query_types=spath(_raw,"query_type{}")
| eval ttls=spath(_raw,"ttl{}")

 but this does not in props.conf:

[stream:dns]
EXTRACT-host_addresses = spath(_raw,"host_addr{}")
EXTRACT-message_types = spath(_raw,"message_type{}")
EXTRACT-hostnames = spath(_raw,"hostname{}")
EXTRACT-names = spath(_raw,"name{}")
EXTRACT-queries = spath(_raw,"query{}")
EXTRACT-query_types = spath(_raw,"query_type{}")
EXTRACT-ttls = spath(_raw,"ttl{}")
0 Karma
1 Solution

FrankVl
Ultra Champion

EXTRACT works with regex, not with spath. You could try with EVAL statements in your props.conf.

But it might make more sense to just apply something like KV_MODE = json in your props.conf. Or just get the splunk stream TA on your search heads, which should be able to handle all the field extraction stuff for such data I would say?

View solution in original post

FrankVl
Ultra Champion

EXTRACT works with regex, not with spath. You could try with EVAL statements in your props.conf.

But it might make more sense to just apply something like KV_MODE = json in your props.conf. Or just get the splunk stream TA on your search heads, which should be able to handle all the field extraction stuff for such data I would say?

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...