Open francisan opened 1 month ago
transferring to contrib repo
Pinging code owners for receiver/webhookevent: @atoulme @shalper2. See Adding Labels via Comments if you do not have permissions to add labels yourself.
@atoulme @shalper2 Could you please help me to resolve this.
@francisan taking a look now!
The behavior comes from the way that go's bufio.Scanner
implements its default Scan() behavior. By default Scan()
advances the buffer to the next token using a SplitFunc
which stops at newline and return characters. This causes the for sc.Scan()
loop in webhookevent receiver's req_to_log.go
to create a new log entry for each newline encountered (which is what you're seeing). I do not think this behavior is desirable for the webhookevent receiver and so I will try to push a fix.
Removing needs triage
based on code owner response.
Thanks @crobert-1 One Observation---- It happens when I use postman for triggering API. If we call webhookevent API from a java program using rest template, then it's not happening.
I am facing one issue in below webhookevent receiver.
receivers: webhookevent:
processors: transform/tr:
exporters: logging: loglevel: debug
service: pipelines:
logs/receivers: receivers: [webhookevent] processors: [transform/tr] exporters: [logging]
If I put any new line in between Json, then rather than considering it as a single log statement, it will consider it as two different log statements.
For example,
If we use below Json, then it will consider it as a single log. We are good here. {"name" : "francis" ,"city" : "newyork"}
But if we use below Json, then it will consider it as 4 different logs. I think, ideally it should consider it as a single log statement.
{ "name": "francis", "city": "newyork" }
{ --->log1 "name": "francis", --->log2 "city": "newyork" --->log3 } --->log4
Why is it behaving in this way?