Knowledge Management

Calculated field

VijaySrrie
Builder

Hi Team,

I have a field extraction  and a calculated field which is not working
Please let me know whether there is any other way to extract it

EXTRACT-User = \"path\"\:\"auth\/(abc|xyz)\/login\/(?<User>[\w\_]+)
EVAL-user = if(error="invalid credentials",User,'auth.display_name')



"auth.display_name" is the existing field

Labels (2)
0 Karma

antoniolamonica
SplunkTrust
SplunkTrust

Before you do your eval statement, test that your extraction works.
In your query, use a rex statement to see test this.

...
| rex field=<your_field> "\"path\"\:\"auth\/(abc|xyz)\/login\/(?<User>[\w\_]+)"
...


Then once you confirm you extracting your User field values, add the eval statement in the query.
Once you confirm that works, you can then go back to your sourcetype, and modify your extract and eval lines. 
---
If this reply helps you, Karma would be appreciated.

Tags (3)
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...