Splunk Search

Regex expression correction

kailun92
Communicator

I used (?i)location : (?P.+) to extract the location. But it always extract the word below it (None). Anyone knows how to solve this ? I need to extract only Choa Chu Kang.

My data is

cloudCover : 0.75
dewPoint: 21.42
humidity: 54.00
icon : partly-cloudy-day
ozone : 274.19
precipIntensity : 0.003
precipProbability : 0.04
precipType : rain
pressure : 1007.45
summary : Mostly Cloudy
temperature: 31.68
visibility : 6.21
windBearing : 139
windSpeed : 11.9
psiAverage : 19
latitude : 1.394557
longitude : 103.746396
location : Choa Chu Kang
None

Tags (2)
0 Karma
1 Solution

okrabbe_splunk
Splunk Employee
Splunk Employee

You could try something like this which is a bit more explicit.

(?im)^location\s:\s(?P<current_location>[^\n]+)

View solution in original post

okrabbe_splunk
Splunk Employee
Splunk Employee

You could try something like this which is a bit more explicit.

(?im)^location\s:\s(?P<current_location>[^\n]+)

kailun92
Communicator

Thanks ! it works

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 ...