Metricbeat beat module works for metricbeat but not for filebeat

I have this configuration for metricbeat beat module. It shows up absolutely fine on the kibana.

metricbeat.autodiscover:
       providers:
         - type: kubernetes
           templates:
             - condition:
                 contains:
                   kubernetes.labels.app: "app=metricbeat-metricbeat"
               config:
                 - module: beat
                   metricsets: ["stats", "state"]
                   hosts: "${data.host}:5066" 
                   xpack.enabled: true 
 
      metricbeat.autodiscover:
       providers:
         - type: docker
           labels.dedot: true
           templates:
             - condition:
                 contains:
                   docker.container.name: "metricbeat"
               config:
                 - module: beat
                   metricsets: ["stats", "state"]
                   hosts: "localhost:5066" 
                   xpack.enabled: true  

But, when I add the following for filebeat, it doesn't show up in kibana. I have also added kubernetes type along with below and it doesn't work. It doesn't show any errors in the metricbeat pod logs.

     metricbeat.autodiscover:
       providers:
         - type: docker
           labels.dedot: true
           templates:
             - condition:
                 contains:
                   docker.container.name: "filebeat"
               config:
                 - module: beat
                   metricsets: ["stats", "state"]
                   hosts: "localhost:5066" 
                   xpack.enabled: true  

Please advice.

Thanks.