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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...