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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...