Splunk Search

How can I search to filter?

sekhar463
Path Finder

hai All,

i have events like below 

from how can i filter events if for ex: 6th character in C*E**M  IS M want to filter all OR 6th character is H how can i filter all those

please assist

C*E**M****} JAWS Process to copy the legacy Virtu ORDERDETAILSs data from IMFT to network folder
C*E**M****} JAWS Process to copy the legacy Virtu Orders data from IMFT to network folder
C*E**M****} box that contains the processes to load Portware EOD files to APP_ETT database
C*E**M****} box that load the OMS legacy tables 1 11.111%
C*E3VL****} Box that contains the jobs to download and process the ITG Placement Inbound file
C*E**H****}ox that contains the processes t

Labels (2)
0 Karma

scelikok
SplunkTrust
SplunkTrust

You can filter using two methods, 

index=index_name source=sourcetype 
| regex _raw="DESCRIPTION=\".{5}(?:M|H)" 
| table JOID,JOB_NAME,DESCRIPTION,JOB_GROUP,STATUS,LAST_START,LAST_END,NEXT_START,RUNTIME
| sort -time

Or,

index=index_name source=sourcetype 
| rex "DESCRIPTION=\".{5}(?<sixth_char>.)"
| table JOID,JOB_NAME,sixth_char,DESCRIPTION,JOB_GROUP,STATUS,LAST_START,LAST_END,NEXT_START,RUNTIME
| search sixth_char IN ("H","M")
| sort -time
If this reply helps you an upvote and "Accept as Solution" is appreciated.

scelikok
SplunkTrust
SplunkTrust

Hi @sekhar463,

I thought that you wanted to extract the sixth char, please try below to filter,

| regex _raw="DESCRIPTION=\".{5}(?:M|H)"

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

sekhar463
Path Finder

not getting results

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @sekhar463,

You use below to extract 6th char in events;

| rex "^.{5}(?<sixth_char>.)"
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

sekhar463
Path Finder

while adding this regex its giving 0 

actually once extracted i want to create 

can you give me the correct query please. i am using below query

 

index=index_name source=sourcetype | rex "^.{5}(?<sixth_char>.)"
| table JOID,JOB_NAME,sixth_char,DESCRIPTION,JOB_GROUP,STATUS,LAST_START,LAST_END,NEXT_START,RUNTIME
| sort -time

0 Karma

sekhar463
Path Finder

getting Zero while executing 

sample event

 

2023-01-16 03:30:01.715, JOID="80562", NAME="jobs name", DESCRIPTION="C***VM****}  extracting crd data from CS_BROKER table for ", JOB_NAME="job name",  RUN_NUM="408972404", NTRY="1", AVG_RUN_TIME="34",  STATUS_CODE="4", STATUS="SUCCESS", STATUS_TIME="2023/01/13 17:04:03", LAST_START="2023/01/13 17:03:29", LAST_END="2023/01/13 17:04:02", DATE_CONDITIONS="0", RUNTIME="33", EXIT_CODE="0"

 

 

 

 

 

0 Karma
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

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

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...