diff --git a/dnsutils/dnsmessage.go b/dnsutils/dnsmessage.go index ccb8a701..fa372d94 100644 --- a/dnsutils/dnsmessage.go +++ b/dnsutils/dnsmessage.go @@ -122,8 +122,8 @@ type PowerDNS struct { AppliedPolicyType string `json:"applied-policy-type"` Metadata map[string]string `json:"metadata"` HTTPVersion string `json:"http-version"` - MessageId string `json:"message-id"` - InitialRequestorId string `json:"initial-requestor-id"` + MessageID string `json:"message-id"` + InitialRequestorID string `json:"initial-requestor-id"` } type TransformDNSGeo struct { diff --git a/dnsutils/dnsmessage_json_test.go b/dnsutils/dnsmessage_json_test.go index 3dd1d92d..41dc702e 100644 --- a/dnsutils/dnsmessage_json_test.go +++ b/dnsutils/dnsmessage_json_test.go @@ -111,8 +111,8 @@ func TestDnsMessage_Json_Collectors_Reference(t *testing.T) { Tags: []string{"tag1"}, Metadata: map[string]string{"stream_id": "collector"}, HTTPVersion: "http3", - MessageId: "27c3e94ad6284eec9a50cfc5bd7384d6", - InitialRequestorId: "5e006236c8a74f7eafc6af126e6d0689", + MessageID: "27c3e94ad6284eec9a50cfc5bd7384d6", + InitialRequestorID: "5e006236c8a74f7eafc6af126e6d0689", }}, jsonRef: `{ diff --git a/dnsutils/dnsmessage_text.go b/dnsutils/dnsmessage_text.go index 02cfad01..afa68dd0 100644 --- a/dnsutils/dnsmessage_text.go +++ b/dnsutils/dnsmessage_text.go @@ -103,14 +103,14 @@ func (dm *DNSMessage) handlePdnsDirectives(directive string, s *strings.Builder) s.WriteString("-") } case directive == "powerdns-message-id": - if len(dm.PowerDNS.MessageId) > 0 { - s.WriteString(dm.PowerDNS.MessageId) + if len(dm.PowerDNS.MessageID) > 0 { + s.WriteString(dm.PowerDNS.MessageID) } else { s.WriteString("-") } case directive == "powerdns-initial-requestor-id": - if len(dm.PowerDNS.InitialRequestorId) > 0 { - s.WriteString(dm.PowerDNS.InitialRequestorId) + if len(dm.PowerDNS.InitialRequestorID) > 0 { + s.WriteString(dm.PowerDNS.InitialRequestorID) } else { s.WriteString("-") } diff --git a/dnsutils/dnsmessage_text_test.go b/dnsutils/dnsmessage_text_test.go index f2bab686..74299636 100644 --- a/dnsutils/dnsmessage_text_test.go +++ b/dnsutils/dnsmessage_text_test.go @@ -473,13 +473,13 @@ func TestDnsMessage_TextFormat_Directives_Pdns(t *testing.T) { { name: "message_id", format: "powerdns-message-id", - dm: DNSMessage{PowerDNS: &PowerDNS{MessageId: "27c3e94ad6284eec9a50cfc5bd7384d6"}}, + dm: DNSMessage{PowerDNS: &PowerDNS{MessageID: "27c3e94ad6284eec9a50cfc5bd7384d6"}}, expected: "27c3e94ad6284eec9a50cfc5bd7384d6", }, { name: "initial_requestor_id", format: "powerdns-initial-requester-id", - dm: DNSMessage{PowerDNS: &PowerDNS{InitialRequestorId: "5e006236c8a74f7eafc6af126e6d0689"}}, + dm: DNSMessage{PowerDNS: &PowerDNS{InitialRequestorID: "5e006236c8a74f7eafc6af126e6d0689"}}, expected: "5e006236c8a74f7eafc6af126e6d0689", }, } diff --git a/workers/powerdns.go b/workers/powerdns.go index 94530e73..70e67132 100644 --- a/workers/powerdns.go +++ b/workers/powerdns.go @@ -359,8 +359,8 @@ func (w *PdnsProcessor) StartCollect() { } // get id - pdns.MessageId = hex.EncodeToString(pbdm.MessageId) - pdns.InitialRequestorId = hex.EncodeToString(pbdm.InitialRequestId) + pdns.MessageID = hex.EncodeToString(pbdm.MessageId) + pdns.InitialRequestorID = hex.EncodeToString(pbdm.InitialRequestId) // finally set pdns to dns message dm.PowerDNS = &pdns