File

File#

This output plugin writes metrics into file.

Note

Metrics provided by file output plugin will not be available in nJAMS Argos.

Configuration:

This plugin needs to be configured in a separate file. Therefore create a file <your_path>/agent/config/file/file.conf:

[[outputs.file]]
    ## Files to write to, "stdout" is a specially handled file.
    files = ["stdout", "/tmp/metrics.out"]

    ## Use batch serialization format instead of line based delimiting.  The
    ## batch format allows for the production of non line based output formats and
    ## may more effiently encode and write metrics.
    # use_batch_format = false

    ## The file will be rotated after the time interval specified.  When set
    ## to 0 no time based rotation is performed.
    # rotation_interval = "0h"

    ## The logfile will be rotated when it becomes larger than the specified
    ## size.  When set to 0 no size based rotation is performed.
    # rotation_max_size = "0MB"

    ## Maximum number of rotated archives to keep, any older logs are deleted.
    ## If set to -1, no archives are removed.
    # rotation_max_archives = 5

Reference the plugin in your njams_agent.conf

[[outputs.execd]]
    command = ["<your_path>/agent/bin/njams_agent", "--config", "<your_path>/agent/config/file/file.conf"]

Alternatively, it is possible to manage your configuration file on a HTTP/S server and provide it via URL to your njams_agent.conf:

[[inputs.execd]]
    command = ["<your_path>/agent/bin/njams_agent", "--config", "http://example.org/file.conf"]