Splunk Search

No regex could be learned. Try providing different examples or restriction.

hikari992
Explorer

Hi everyone, I'm quite new to splunk.
I encounter this error message "No regex could be learned. Try providing different examples or restriction." while I was trying to extract longitude value using the Interactive field extractor. But I was able to extract Latitude value and this is the regex for the Latitude value that display in the props.conf file "EXTRACT-Latitude = (?i).Double">(?P[^<]+)". Please help me. Thank you.

0 Karma

kristian_kolb
Ultra Champion

1.4004771683629058/d:latitude
103.8579338813216/d:longitude

Given the data format above, I would choose to do like so;

props.conf

[your_sourcetype]
EXTRACT-lat = >(?<latitude>[^<]+)</d:latitude
EXTRACT-long = >(?<longitude>[^<]+)</d:longitude

/K

Ayn
Legend

Just use the Latitude extraction as a template here, change latitude for longitude in both places and you should be good to go.

0 Karma

Ayn
Legend

Oh, right. Didn't see that 🙂

0 Karma

kristian_kolb
Ultra Champion

Problem is that the EXTRACT in the original question would capture both long and lat, calling them both latitude (or just keeping one of them if it's not a multi-valued field).

0 Karma

hikari992
Explorer

Hi, it's a xml data.
1.4004771683629058/d:Latitude
103.8579338813216/d:Longitude

0 Karma

Ayn
Legend

Log samples please? Hard to tell you what your regular expression should look like otherwise.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...