Hello,
I have three tables
START => ThreadID, KeyID, TaskID, Epoch
END => ThreadID, KeyID, TaskID, Epoch
TIME => ThreadID, KeyID, Time
In Grafana, how can I join these three tables so that the output is
ThreadID, KeyID, Time, TaskID, Difference (End Epoch - Start Epoch)
Loki.
START and END queries use:
{filename="/var/log/execution_time.log"} | pattern <time> THREADID=\<threadId> KEYID=\<keyId> TASK=\<task> STATUS=<status> EPOCH=<epoch>
TIME use:
{filename="/var/log/execution_time.log"} | pattern <time> THREADID=<\threadId> KEYID=\<keyId> <_> <_> <_>
if not doable using the native query language (logql) here is an ugly and tedious way of doing it using transformations
3 Join By fields and 1add from Calculation
and 1 Organize fields
Results in
I am sorry but this approach does not work. Because the third table TIME only contains ThreadID, KeyID and there is no TaskID. So when I apply the JOIN transformation, the Time column is lost
START => ThreadID, KeyID, TaskID, Epoch
END => ThreadID, KeyID, TaskID, Epoch
TIME => ThreadID, KeyID, Time