How to log data from timebeat to a file on the same device

Default config for logging to file:

# -------------------------------- File Output ---------------------------------
#output.file:
  # Boolean flag to enable or disable the output module.
  #enabled: true

  # Configure JSON encoding
  #codec.json:
    # Pretty-print JSON event
    #pretty: false

    # Configure escaping HTML symbols in strings.
    #escape_html: false

  # Path to the directory where to save the generated files. The option is
  # mandatory.
  #path: "/tmp/timebeat"

  # Name of the generated files. The default is `timebeat` and it generates
  # files: `timebeat`, `timebeat.1`, `timebeat.2`, etc.
  #filename: timebeat

  # Maximum size in kilobytes of each file. When this size is reached, and on
  # every Timebeat restart, the files are rotated. The default value is 10240
  # kB.
  #rotate_every_kb: 10000

  # Maximum number of files under path. When this number of files is reached,
  # the oldest file is deleted and the rest are shifted from last to first. The
  # default is 7 files.
  #number_of_files: 7

  # Permissions to use for file creation. The default is 0600.
  #permissions: 0600
  
  # Configure automatic file rotation on every startup. The default is true.
  #rotate_on_startup: true

 

To log to a file modify the following lines (ensure all other logging configurations are disabled i.e logging to elasticsearch is set to false):

 

# -------------------------------- File Output ---------------------------------
output.file:
  # Boolean flag to enable or disable the output module.
  enabled: true

  # Configure JSON encoding
  codec.json:
    # Pretty-print JSON event
    pretty: true

  # Path to the directory where to save the generated files. The option is
  # mandatory.
  path: "/tmp/timebeat"

  # Name of the generated files. The default is `timebeat` and it generates
  # files: `timebeat`, `timebeat.1`, `timebeat.2`, etc.
  filename: timebeat