Skip to content

Unable to use list of specific files in file module - cannot unmarshal !!seq into string #202

@ilyadiff

Description

@ilyadiff

When I specify a list of certificate files in this desired configuration

---
default_module: file
modules:
  file:
    prober: file
    target:
      - "/etc/opensearch/os01_http.pem"
      - "/etc/opensearch/os01_transport.pem"

I get an error

caller=ssl_exporter.go:143 level=error msg="error parsing config file: yaml: unmarshal errors:\n line 7: cannot unmarshal !!seq into string
And so I have to use the following configuration to specify the necessary files.

---
default_module: file
modules:
  file1:
    prober: file
    target: "/etc/opensearch/os01_http.pem"
  file2:
    prober: file
    target: "/etc/opensearch/os01_transport.pem"

and it works for me, but it's inconvenient for a number of reasons.
I can't specify all files by mask like /etc/opensearch/*_*.pem inside the directory
because, for example, there may be other certificates in the catalog that do not need to be monitored and there is no way to exclude them from monitoring

Is it possible to correct this behavior and make the "target" parameter to be a list ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions