Dashboards & Visualizations

How to fetch the start and the End Time from row logs

aditsss
Motivator

Hi Team,

How can I fetch the start and end time from below logs:

2023-08-30 00:29:00.018 [INFO ] [pool-3-thread-1] ReadControlFileImpl - Reading Control-File /absin/CARS.HIERCTR.D082923.T002302

2023-08-30 07:43:29.020 [INFO ] [Thread-18] FileEventCreator - Completed Settlement file processing, TRIM.UNB.D082923.T045920 records processed: 13283520

I want this start time and end time

can someone help me with query

my current query:

index="abc"sourcetype ="600000304_gg_abs_ipc2" source="/amex/app/gfp-settlement-raw/logs/gfp-settlement-raw.log"
"Reading Control-File /absin/CARS.HIERCTR."

 

 

Labels (3)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

I’m expecting that those are two different events and with your sample query you get only the 1st event not both? If this is true, you must first implement a SPL query which result contains both events. Then there must be something common on those events to connect those together. On your example events I can’t see anything like that! Probably you must find some other logs which you could use to combine all events on one transaction together?

Only common factor between those event are D082923, but it seems to be part of file name or something? I assume that it’s using as this on many transactions and cannot use as identity only on transaction?

r. Ismo

0 Karma

GaetanVP
Contributor

Hello @aditsss,

If you are receiving those two lines in the same event you could try to use something like this :

index="abc"sourcetype ="600000304_gg_abs_ipc2" source="/amex/app/gfp-settlement-raw/logs/gfp-settlement-raw.log"
"Reading Control-File /absin/CARS.HIERCTR."
| rex "(?<starttime>.*?)\s\[.*\s\].*[\r\n]+(?<endtime>.*?)\s\[.*\s\].*"

This gave me the following results :

GaetanVP_0-1693495483320.png

Hope it helps !
GaetanVP

 

0 Karma

aditsss
Motivator

@GaetanVP 

I tried below query not getting any result

index="abcsourcetype ="600000304_gg_abs_ipc2" source="/amex/app/gfp-settlement-raw/logs/gfp-settlement-raw.log"
"Reading Control-File /absin/CARS.HIERCTR."
| rex "(?<starttime>.*?)\s\[.*\s\].*[\r\n]+(?<endtime>.*?)\s\[.*\s\].*"| table starttime endtime

also for end process logs are these:

2023-08-30 04:09:30.458 [INFO ] [Thread-40] FileEventCreator - Completed Settlement file processing, CARS.HIER.D082923.T002302 records processed: 161076

@GaetanVP please guide

0 Karma

aditsss
Motivator

@GaetanVP could you please guide.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

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 ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...