Hi All, We are working on the parsing of logs and ...
# support
s
Hi All, We are working on the parsing of logs and we are facing multiple issues. Below is the one issue that we are facing when we are trying to parse the access logs. Sample log line
Copy code
"10.21.18.240 - - [22/Mar/2023:08:19:04 +0000] \"GET /status HTTP/1.1\" 200 1249 \"-\" \"kube-probe/1.22+\"\n"
Below is the configuration of custom processor.
Copy code
logstransform/keepattrs:
        operators:
          - type: remove
            id: remove-1
            field: attributes
      logstransform/parselog:
        operators:
          - type: router
            id: get-access
            routes:
              - output: parser-access
                expr: 'body matches "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}"'
          - type: grok_parser
            id: parser-access
            parse_from: body
            pattern: '%{IP:ip}%{SPACE}-%{SPACE}-%{SPACE}\[%{HTTPDATE:timestamp}\]%{SPACE}\\"%{WORD:httpmethod}%{SPACE}%{DATA:request}\"%{SPACE}%{NUMBER:status}'
            parse_to: attributes
Grok debugger output. I am getting below error.
Copy code
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x24701e1]

goroutine 1 [running]:
<http://github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.(*receiver).Shutdown(0xc00107ccf0|github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.(*receiver).Shutdown(0xc00107ccf0>, {0x52eba28, 0xc000076028})
	/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.66.0/adapter/receiver.go:148 +0x81
<http://go.opentelemetry.io/collector/service/internal/pipelines.(*Pipelines).ShutdownAll(0xc000f781e0|go.opentelemetry.io/collector/service/internal/pipelines.(*Pipelines).ShutdownAll(0xc000f781e0>, {0x52eba28, 0xc000076028})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/internal/pipelines/pipelines.go:121 +0x499
<http://go.opentelemetry.io/collector/service.(*service).Shutdown(0xc000f5a800|go.opentelemetry.io/collector/service.(*service).Shutdown(0xc000f5a800>, {0x52eba28, 0xc000076028})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/service.go:121 +0xd4
<http://go.opentelemetry.io/collector/service.(*Collector).shutdownServiceAndTelemetry(0xc001717a88|go.opentelemetry.io/collector/service.(*Collector).shutdownServiceAndTelemetry(0xc001717a88>, {0x52eba28?, 0xc000076028?})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/collector.go:264 +0x36
<http://go.opentelemetry.io/collector/service.(*Collector).setupConfigurationComponents(0xc001717a88|go.opentelemetry.io/collector/service.(*Collector).setupConfigurationComponents(0xc001717a88>, {0x52eba28, 0xc000076028})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/collector.go:166 +0x27d
<http://go.opentelemetry.io/collector/service.(*Collector).Run(0xc001717a88|go.opentelemetry.io/collector/service.(*Collector).Run(0xc001717a88>, {0x52eba28, 0xc000076028})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/collector.go:190 +0x46
<http://go.opentelemetry.io/collector/service.NewCommand.func1(0xc0005cac00|go.opentelemetry.io/collector/service.NewCommand.func1(0xc0005cac00>, {0x490a0cd?, 0x1?, 0x1?})
	/go/pkg/mod/go.opentelemetry.io/collector@v0.66.0/service/command.go:53 +0x479
<http://github.com/spf13/cobra.(*Command).execute(0xc0005cac00|github.com/spf13/cobra.(*Command).execute(0xc0005cac00>, {0xc00006e070, 0x1, 0x1})
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
<http://github.com/spf13/cobra.(*Command).ExecuteC(0xc0005cac00)|github.com/spf13/cobra.(*Command).ExecuteC(0xc0005cac00)>
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bc
<http://github.com/spf13/cobra.(*Command).Execute(...)|github.com/spf13/cobra.(*Command).Execute(...)>
	/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
main.runInteractive({{0xc0006bdb90, 0xc00082aea0, 0xc00082a120, 0xc0006bd7d0}, {{0x4943e48, 0x15}, {0x49417a5, 0x15}, {0x49065d8, 0x6}}, ...})
	/src/cmd/signozcollector/main.go:37 +0x5e
main.run(...)
	/src/cmd/signozcollector/main_others.go:8
main.main()
	/src/cmd/signozcollector/main.go:30 +0x1d8