Get a number in a log line to search with it

Hello all,

maybe someone can help me with my question:

  • What Grafana version and what operating system are you using?
    Grafana 10.4.1 with Elasticsearch 8.13.2 (I downloaded the newest versions from both)
    a few weeks ago)

I use Filebeat to process the data into elasticsearch from my log lines with the dissect processor.

  • What are you trying to achieve?
    I have a log file which tracks some proccesses. Let’s say there are log lines like

23/05/2024 3:12:22,222 ProcessName=“StartReading” 123456789
(…more log lines…)
23/05/2024 3:12:30,123 ProcessName=“StartReading” 444455555
(…more log lines…)
23/05/2024 3:14:44,637 ProcessName=“StopReading” 123456789
(…more log lines…)
23/05/2024 3:14:50,456 ProcessName=“StartReading” 444455555

Also, in the log files are other log lines that can be ignored.

First, I want to search for all log lines with the ProccessName “StartReading”. I did this with the Lucene Query processname=“StartReading”. This works for me. All the log lines with this process are shown.

Now for each process I want to get the number behind. For the first log line this would be 123456789 and now I want to search the next log lines with that number which is the StopReading Process. So each process has an individual number which appears in the Start Process and the End Process Line.

In the end, I want to calculate the time between the two lines.

Is this possible with Grafana? Do you need more informations? This are only example log lines as I cannot show the original ones.

Thanks and kind regards.