Getting Data In

Multiple fields extraction,m using props.conf

edwinmae
Path Finder

Hi,

We have a search that extracts Customer and Country correctly

index=aaa host="Host1" sourcetype=aaa_bbb | rex field=source "C:\\DIR\(?\w*)\(?\w*)" | table source,Customer,Country

source example = C:\DIR\CustomerX\CountryX\Web\log\2017-12-bbb.log

--

Now we want to use props.conf for extracting these 2 fields

When modifying the props.conf on the Splunk server (/opt/splunk/etc/system/local/props.conf)

[aaa_bbb]
EXTRACT-Customer,Country = C:\\DIR\(?\w*)\(?\w*) in source

After rebooting the server the fields are not there (we tried different options, none seem to work)

Please advise how we could extract these fields 'automatically' using props.conf

Thanks

/Edwin

1 Solution

harsmarvania57
Ultra Champion

Hi @edwinmae,

I have tried with below configuration in props.conf in splunk 7.0.1

[custom_st]
EXTRACT-Country,Customer = C:\\DIR\\(?<Customer>\w*)\\(?<Country>\w*) in source

And it's working fine with sample data which you have provided, please find below screenshot in which Country and Customer field is extracted properly.

alt text

View solution in original post

0 Karma

harsmarvania57
Ultra Champion

Hi @edwinmae,

I have tried with below configuration in props.conf in splunk 7.0.1

[custom_st]
EXTRACT-Country,Customer = C:\\DIR\\(?<Customer>\w*)\\(?<Country>\w*) in source

And it's working fine with sample data which you have provided, please find below screenshot in which Country and Customer field is extracted properly.

alt text

0 Karma

edwinmae
Path Finder

It worked 🙂

0 Karma

abhijeet01
Path Finder

Hi @edwinmae

PFA alt text
You can use this regex in props.conf file.

0 Karma

edwinmae
Path Finder

I tried that as well, but it doesn't work

0 Karma

nickhills
Ultra Champion

Your not specifying the extracted field names

try:
EXTRACT-Customer,Country = C:\\\DIR\\(?<customer>\w*)\\(?<country>\w*) in source

If my comment helps, please give it a thumbs up!
0 Karma

edwinmae
Path Finder

Something went wrong with copying. my apologies
The normal search is working and get the source, Customer and County, but not through props.conf

So I had the below in props.conf, but it doesn't work

[aaa_bbb]
EXTRACT-Customer,Country = C:\\TEM\(?\w*)\(?\w*) in source

0 Karma

nickhills
Ultra Champion

oh wait ! i think there are too many \\'s

try
EXTRACT-Customer,Country = C:\\DIR\\(?<customer>\w*)\\(?<country>\w*) in source

If my comment helps, please give it a thumbs up!
0 Karma

edwinmae
Path Finder

still not working for me

0 Karma

nickhills
Ultra Champion

whats the stanza named?

If my comment helps, please give it a thumbs up!
0 Karma

nickhills
Ultra Champion

I just came across your other post.

Can you confirm this is exactly what you have?

[source::C:\Web\*\*\Web\log\mobile.log]
 EXTRACT-Customer_Country = C:\\Web\\(?<customer>\w*)\\(?<country>\w*) in source

 [source::C:\Web\*\*\Web\log\web.log]
 EXTRACT-Customer_Country = C:\\Web\\(?<customer>\w*)\\(?<country>\w*) in source

I say 'exactly', because although windows is not case sensitive, Splunk on windows is!

If my comment helps, please give it a thumbs up!
0 Karma

edwinmae
Path Finder

I have another post?

We also tried using the props.conf from the Splunk Forwarder (on the web server)

[source::C:\DIR......\Web\log*bbb.log]
EXTRACT-Customer,Country = C:\\DIR\(?\w*)\(?\w*) in source

--

The inputs.conf (on the web server) looks like this:

[monitor://C:\DIR**\Web\log*bbb.log]
disabled = 0
ignoreOlderThan = 3d
followTail = 0
sourcetype = aaa_bbb
crcSalt =
index = aaa

--

The props.conf file on the Splunk server

stanza = aaa_bbb (=sourcetype)

[aaa_bbb]
EXTRACT-Customer,Country = C:\DIR\(?\w*)\(?\w*) in source

tried with \\ and \

Using normal search with rex works fine

index=aaa sourcetype=aaa_bbb | rex field=source "C:\\DIR\(?\w*)\(?\w*)" | table source,Customer,Country

--

Unfortunately the props.conf doesn't work

We use Splunk 7.0.0 (Server and Forwarder)

the source = Log path is same for all Customers:
C:\DIR\Customer\Country\Web\log\2017-12-bbb-log

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...