Splunk Search

Using search regex fails when the fieldname is a number

nnachefski
Engager

So i have this regex:

| regex sy="\S{4,10}"

which works fine. I'm telling it to match only on non-whitespace characters 4 to 10 chars in length.

But, when i change the fieldname to a number the regex fails every time.

| regex 1="\S{4,10}"

I tried the following with no luck:

| regex "1"="\S{4,10}"

| regex "1=\S{4,10}"

Any help would be greatly appreciated.

Tags (2)
0 Karma

araitz
Splunk Employee
Splunk Employee

Field names cannot begin with a number, so "1" is not a valid field name.

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...