From ad7312c6050cbff032b53d652c61586bdc984c2e Mon Sep 17 00:00:00 2001 From: Alexey Oplachko Date: Thu, 27 Jun 2024 18:19:29 +0300 Subject: [PATCH] feat: adds transport protocol label sipcapture/homer#634 --- remotelog/loki.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remotelog/loki.go b/remotelog/loki.go index b20d087..df34ba7 100644 --- a/remotelog/loki.go +++ b/remotelog/loki.go @@ -137,6 +137,13 @@ func (l *Loki) start(hCh chan *decoder.HEP) { case pkt.SIP != nil && pkt.ProtoType == 1: l.entry.labels["method"] = model.LabelValue(pkt.SIP.CseqMethod) l.entry.labels["response"] = model.LabelValue(pkt.SIP.FirstMethod) + protocol := "" + if pkt.Protocol == 6 { + protocol = "tcp" + } else if pkt.Protocol == 17 { + protocol = "udp" + } + l.entry.labels["protocol"] = model.LabelValue(protocol) case pkt.ProtoType == 100: protocol := "udp" if strings.Contains(pkt.Payload, "Fax") || strings.Contains(pkt.Payload, "T38") {