File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ package newrelic
8
8
import (
9
9
"bytes"
10
10
"encoding/json"
11
- "github.com/newrelic/newrelic-php-agent/daemon/internal/newrelic/log"
12
11
"time"
12
+
13
+ "github.com/newrelic/newrelic-php-agent/daemon/internal/newrelic/log"
13
14
)
14
15
15
16
// LogEvents is a wrapper over AnalyticsEvents created for additional type
@@ -46,6 +47,15 @@ func (events *LogEvents) SetLogForwardingLabels(data []byte) {
46
47
if nil != err {
47
48
log .Errorf ("failed to unmarshal log labels json" , err )
48
49
}
50
+
51
+ // verify valid labels
52
+ for idx := range events .LogForwardingLabels {
53
+ if len (events .LogForwardingLabels [idx ].LabelType ) == 0 || len (events .LogForwardingLabels [idx ].LabelValue ) == 0 {
54
+ log .Errorf ("invalid log label: %s log value: %s" , events .LogForwardingLabels [idx ].LabelType , events .LogForwardingLabels [idx ].LabelValue )
55
+ events .LogForwardingLabels = nil
56
+ break
57
+ }
58
+ }
49
59
}
50
60
51
61
// FailedHarvest is a callback invoked by the processor when an
You can’t perform that action at this time.
0 commit comments