Agiftel Longwave
Agiftel Longwave

Reputation: 47

Write right LOGQL query

I need to create a grafana dashboard that give me as result total number of "SipSessionId" per hour in a time range of 24h. I tried many LOGQL query, without luck. Can you help me understand?

Here my starting log:

{
  "message": "<181>[S=34] |STOP         |Mediant SW                   |184      |35     |81a539:184:619  |15:54:48.171  UTC Tue Aug 27 2024|711           |18001         |UTC     |2000                |2000                |1000                |1000                |192.168.10.1        |192.168.10.1        |RELEASE_BECAUSE_MAX_DURATION_TIMER_EXPIRED|BYE                 |Telecom                         |Telecom                         |0",
  "host": "192.168.10.11",
  "udp_port": "514",
  "tags": [
    "CDR"
  ],
  "@timestamp": "2024-08-27T13:57:56.662Z",
  "@version": "1",
  "origin": "MYORIGIN",
  "Internal_Seq": 181,
  "SDR_Seq_Num": 34,
  "RecordType": "STOP",
  "ProductName": "Mediant SW",
  "ShelfInfo": 184,
  "SeqNum": 35,
  "SipSessionId": "81a539:184:619",
  "SetupTime": "15:54:48.171",
  "TimeZone": "UTC",
  "Day": "Tue",
  "Month": "Aug",
  "Monthday": 27,
  "Year": 2024,
  "TimeToConnect": 7.11,
  "CallDuration": 180.01,
  "NodeTimeZone": "UTC",
  "IngressCallingUserName": 2000,
  "EgressCallingUserName": 2000,
  "IngressDialedUserName": 1000,
  "EgressCalledUserName": 1000,
  "IngressCallSourceIp": "192.168.10.1",
  "EgressCallDestIp": "192.168.10.1",
  "EgressTrmReason": "RELEASE_BECAUSE_MAX_DURATION_TIMER_EXPIRED",
  "EgressSIPTrmReason": "RELEASE_BECAUSE_MAX_DURATION_TIMER_EXPIRED",
  "IngressSipInterfaceName": "BYE",
  "EgressSipInterfaceName": "BYE",
  "RouteAttemptNum": "Telecom"
}

and here some query example:

sum by (SipSessionId) (
    count_over_time(
        {origin="MYORIGIN"} | json | SipSessionId !="" | __error__="" [$__range]
    )
)


sum(count_over_time({origin="AUDIOCODES"} [5m])) by (hour)

Thank you

Upvotes: 0

Views: 22

Answers (0)

Related Questions