MerlinDMC / fluent-plugin-input-gelf

A GELF input for Fluentd
MIT License
8 stars 15 forks source link

input not reached #14

Open jeusdi opened 4 years ago

jeusdi commented 4 years ago

I'm running fluentd into my k8s cluster (k3d).

I've installed fluent-plugin-input-gelf-0.3.1, with this configuration:

<source>
  @type gelf
  tag "example.gelf"
  bind "0.0.0.0"
  port 12201
</source>

These are the logs:

[info]: #0 starting fluentd worker pid=17 ppid=8 worker=0
[info]: #0 listening gelf socket on 0.0.0.0:12201 with udp
[info]: #0 listening port port=24224 bind="0.0.0.0"
[info]: #0 fluentd worker is now running worker=0

As you can see gelf input plugin is listening at port 12201 with udp.

Also manager is listening on 24224.

These are my services:

$ kubectl describe service -l app=fluentd
Name:              fluentd-1582814293
Namespace:         logging
Labels:            app=fluentd
                   chart=fluentd-2.3.2
                   heritage=Helm
                   release=fluentd-1582814293
Annotations:       <none>
Selector:          app=fluentd,release=fluentd-1582814293
Type:              ClusterIP
IP:                10.43.205.18
Port:              monitor-agent  24220/TCP
TargetPort:        24220/TCP
Endpoints:         10.42.1.13:24220
Port:              gelf  12201/UDP
TargetPort:        12201/UDP
Endpoints:         10.42.1.13:12201
Session Affinity:  None
Events:            <none>

And here my ingress:

$ kubectl describe ingresses.networking.k8s.io fluentd-1582814293
Name:             fluentd-1582814293
Namespace:        logging
Address:          172.18.0.4
Default backend:  default-http-backend:80 (<none>)
Rules:
  Host                       Path  Backends
  ----                       ----  --------
  monitor.fluentd.localhost  
                             /   fluentd-1582814293:24220 (10.42.1.13:24220)
  gelf.fluentd.localhost     
                             /   fluentd-1582814293:12201 (10.42.1.13:12201)
Annotations:
Events:  <none>

I've been able to get something from monitor-agent:

$ curl http://monitor.fluentd.localhost/api/plugins.json | jq
{
  "plugins": [
    {
      "plugin_id": "object:3f92319dde80",
      "plugin_category": "input",
      "type": "forward",
      "config": {
        "@type": "forward",
        "port": "24224",
        "bind": "0.0.0.0"
      },
      "output_plugin": false,
      "retry_count": null
    },
    {
      "plugin_id": "object:3f9231206ab8",
      "plugin_category": "input",
      "type": "gelf",
      "config": {
        "@type": "gelf",
        "tag": "example.gelf",
        "bind": "0.0.0.0",
        "port": "12201"
      },
      "output_plugin": false,
      "retry_count": null
    },
    {
      "plugin_id": "object:3f9231257a94",
      "plugin_category": "input",
      "type": "http",
      "config": {
        "@type": "http",
        "port": "9880",
        "bind": "0.0.0.0"
      },
      "output_plugin": false,
      "retry_count": null
    },
    {
      "plugin_id": "object:3f92312b15e4",
      "plugin_category": "input",
      "type": "monitor_agent",
      "config": {
        "@type": "monitor_agent",
        "bind": "0.0.0.0",
        "port": "24220",
        "tag": "fluentd.monitor.metrics"
      },
      "output_plugin": false,
      "retry_count": null
    },
    {
      "plugin_id": "object:3f923428453c",
      "plugin_category": "output",
      "type": "null",
      "config": {
        "@type": "null"
      },
      "output_plugin": true,
      "retry_count": 0,
      "retry": {}
    },
    {
      "plugin_id": "object:3f92348c5964",
      "plugin_category": "output",
      "type": "null",
      "config": {
        "@type": "null"
      },
      "output_plugin": true,
      "retry_count": 0,
      "retry": {}
    },
    {
      "plugin_id": "elasticsearch",
      "plugin_category": "output",
      "type": "elasticsearch",
      "config": {
        "@id": "elasticsearch",
        "@type": "elasticsearch",
        "@log_level": "info",
        "include_tag_key": "true",
        "host": "elasticsearch-master",
        "port": "9200",
        "scheme": "http",
        "ssl_version": "TLSv1",
        "logstash_format": "true"
      },
      "output_plugin": true,
      "buffer_queue_length": 0,
      "buffer_total_queued_size": 0,
      "retry_count": 0,
      "retry": {}
    }
  ]
}

However, I've not able to communicate with gelf source input plugin. This is the output of my service is trying to communicate with fluent:

Listening for transport dt_socket at address: 5005
INFO  [io.quarkus] (main) Quarkus 1.1.0.Final started in 1.798s. Listening on: http://0.0.0.0:8080
INFO  [io.quarkus] (main) Profile dev activated. Live Coding activated.
LogManager error of type GENERIC_FAILURE: Port gelf.fluentd.localhost:80 not reachable

I've tested it using fluent-cat cli inside fluentd pod:

$ kubectl exec fluentd-1582814293-5f8dcccc5c-lvv9p -ti sh
# echo '{"message":"hello"}' | fluent-cat example.gelf

It's ingested and forwarded correctly...

However, when I'm trying:

$ kubectl exec fluentd-1582814293-5f8dcccc5c-lvv9p -ti sh
echo '{"message":"hello"}' | fluent-cat --port 12201 debug.log
connect failed: Connection refused - connect(2) for "127.0.0.1" port 12201

Any ideas?

Fran-78 commented 1 year ago

IS it possible for the fluent-plugin-input-gelf to listen using TCP?