Splunk Search

Is there any specific syntax or regex form that help to identify a end line of any log file?

saibal6
Path Finder

I have different log files but the last line of each files are different and don't know what will come tomorrow. So, is there any specific regex form or command available that can easily identify the end line ??

0 Karma
1 Solution

p_gurav
Champion

Hi,

Assuming that timeseries of events is maintain, you can try this command:

index=<your_data_index_> | stats latest(_raw) AS "last line" by source

View solution in original post

p_gurav
Champion

Hi,

Assuming that timeseries of events is maintain, you can try this command:

index=<your_data_index_> | stats latest(_raw) AS "last line" by source

saibal6
Path Finder

Thanks p_gurav,

I have tried with your command and it's working properly as I want.

0 Karma

p_gurav
Champion

Happy to Help!!

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...