fix(parsers.json_v2): Log inner errors (#14296)
This commit is contained in:
parent
004f81651b
commit
a590a1b5b3
|
|
@ -346,6 +346,7 @@ func (p *Parser) expandArray(result MetricNode, timestamp time.Time) ([]telegraf
|
||||||
n.ParentIndex = n.Index + result.ParentIndex
|
n.ParentIndex = n.Index + result.ParentIndex
|
||||||
r, err := p.combineObject(n, timestamp)
|
r, err := p.combineObject(n, timestamp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Log.Error(err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -366,6 +367,7 @@ func (p *Parser) expandArray(result MetricNode, timestamp time.Time) ([]telegraf
|
||||||
n.ParentIndex = n.Index + result.ParentIndex
|
n.ParentIndex = n.Index + result.ParentIndex
|
||||||
r, err := p.expandArray(n, timestamp)
|
r, err := p.expandArray(n, timestamp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Log.Error(err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
results = append(results, r...)
|
results = append(results, r...)
|
||||||
|
|
@ -586,6 +588,7 @@ func (p *Parser) combineObject(result MetricNode, timestamp time.Time) ([]telegr
|
||||||
if val.IsObject() {
|
if val.IsObject() {
|
||||||
results, err = p.combineObject(arrayNode, timestamp)
|
results, err = p.combineObject(arrayNode, timestamp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Log.Error(err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -593,6 +596,7 @@ func (p *Parser) combineObject(result MetricNode, timestamp time.Time) ([]telegr
|
||||||
arrayNode.ParentIndex -= result.Index
|
arrayNode.ParentIndex -= result.Index
|
||||||
r, err := p.expandArray(arrayNode, timestamp)
|
r, err := p.expandArray(arrayNode, timestamp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Log.Error(err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
results = cartesianProduct(r, results)
|
results = cartesianProduct(r, results)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue