Splunk Enterprise

need help on rex

Ash1
Communicator

From the below sample logs we need rex for 

1. "appl has successfully completed all authentication flows."

2. "Login complete"

 

2023-01-11 12:34:22,678 DITAU [taskstatus-8] {DIM: hgtijNMHy67v | DIS: aHJyikjI | DIC: HY56GFT6 | PI: 678.89.987 | ND: ks | APP: |OS: iOS-1-7.1 | REV" } APPDA - 87687654356789 - appl has successfully completed all authentication flows.
2023-01-11 12:34:22,678 DITAU [taskstatus-8] {DIM: hgtijNMHy67v | DIS: aHJyikjI | DIC: HY56GFT6 | PI: 678.89.987 | ND: ks | APP: |OS: iOS-1-7.1 | REV" } APPDA - 87687654356789 - appl has successfully completed all authentication flows.
2023-01-11 12:34:22,678 INFO [taskstatus-8] {DIM: hgtijNMHy67v | DIS: aHJyikjI | DIC: HY56GFT6 | PI: 678.89.987 | ND: ks | APP: | Req: POST /ai/v2/api/assert | OS: iOS-16.6 | VER: 23.4.0} AUDIT - Login complete
2023-01-11 12:34:22,678 INFO [taskstatus-8] {DIM: hgtijNMHy67v | DIS: aHJyikjI | DIC: HY56GFT6 | PI: 678.89.987 | ND: ks | APP: | Req: POST /ai/v2/api/assert | OS: iOS-16.6 | VER: 23.4.0} AUDIT - Login complete

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The rex command is for extracting fields using regular expressions.  What fields do you need to extract from those events?

If you just need to find events with either of those strings then you don't need rex at all.  Just put the strings in your base search.

 

index=foo ( "appl has successfully completed all authentication flows." OR "Login complete" )

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

Ash1
Communicator

Hi @richgalloway , I need to do field extra action for those 2 strings which i mentioned.

That's why I asked for rex

Field 1: appl has successfully completed all authentication flows (field name as success_logins)

Field2: Login complete"  (field name as complete_logins)

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "(?<success_logins>appl has successfully completed all authentication flows.)"
| rex "(?<complete_logins>Login complete)"
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...