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!

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