suzuki-shunsuke/go-graylog

Adding input with type: org.graylog2.inputs.raw.tcp.RawTCPInput produces api error.

Closed this issue ยท 5 comments

Provider seems to report that API is reporting invalid input type when attempting to send this input type.

I can create a input type in the web console and then query it in the API editor and it shows org.graylog2.inputs.raw.tcp.RawTCPInput as the input type that was created.

I am not 100% sure if this is a problem with the provider or the API.

I tried to query the api directly to create the input type but failed for different reasons I don't currently have time to make that happen but this should be reviewed. If the problem is not the provider then we should raise this with graylog directly.

I'll look into it again my next sprint but in the meantime if anyone can verify this and apply a fix that would be great.

Code was:
resource "graylog_input" "kube_events" {
title = "Kube Events Input"
type = "org.graylog2.inputs.raw.tcp.RawTCPInput"

global = true

attributes {
bind_address = "0.0.0.0"
port = 5555
}
}

The exact error I'm getting is:
Error: graylog API error: POST https://logs.invoice2go.io/api/system/inputs 404: There is no such input type registered.

Thank you for your feedback.
I can reproduce.
I can create an Input with Graylog REST API, so it seem to be due to a bug of go-graylog.
I'm checking.

POST /system/inputs

{
  "title": "Kube Events Input",
  "type": "org.graylog2.inputs.raw.tcp.RawTCPInput",
  "global": true,
  "configuration": {
    "bind_address": "0.0.0.0",
    "port": 5555
  }
}

Response Body

{
  "id": "5e1460d1a1de18000d890cd5"
}

Response Code: 201

I have created a pull request.
#215

@suzuki-shunsuke Thanks for doing the PR so quickly. FYI It seems to be failing build for some reason currently.

I'm fixing the build error.
#215 (comment)

@isaacegglestone
I have released v9.0.0.
Please check.