diff --git a/receiver/splunkhecreceiver/splunkhec_to_metricdata.go b/receiver/splunkhecreceiver/splunkhec_to_metricdata.go index e8586d088d6e..d148576c0fac 100644 --- a/receiver/splunkhecreceiver/splunkhec_to_metricdata.go +++ b/receiver/splunkhecreceiver/splunkhec_to_metricdata.go @@ -128,7 +128,7 @@ func buildAttributes(dimensions map[string]any) pcommon.Map { attributes.EnsureCapacity(len(dimensions)) for key, val := range dimensions { - if strings.HasPrefix(key, "metric_name") { + if strings.HasPrefix(key, "metric_name") || key == "_value" { continue } if key == "" || val == nil { diff --git a/receiver/splunkhecreceiver/splunkhec_to_metricdata_test.go b/receiver/splunkhecreceiver/splunkhec_to_metricdata_test.go index 5e5196667fe6..a218bbd83a88 100644 --- a/receiver/splunkhecreceiver/splunkhec_to_metricdata_test.go +++ b/receiver/splunkhecreceiver/splunkhec_to_metricdata_test.go @@ -54,6 +54,19 @@ func Test_splunkV2ToMetricsData(t *testing.T) { wantMetricsData: buildDefaultMetricsData(nanos), hecConfig: defaultTestingHecConfig, }, + { + name: "int_gauge_v7", + splunkDataPoint: func() *splunk.Event { + pt := buildDefaultSplunkDataPt() + delete(pt.Fields, "metric_name:single") + pt.Fields["metric_name"] = "single" + pt.Fields["_value"] = int64Ptr(13) + return pt + + }(), + wantMetricsData: buildDefaultMetricsData(nanos), + hecConfig: defaultTestingHecConfig, + }, { name: "multiple", splunkDataPoint: func() *splunk.Event {