Skip to content

FileCollector

Michiel TJampens edited this page Jun 6, 2021 · 12 revisions

FileCollector

Being a Collector means that it can receive data from a single source and then store it in some form.

This particular collector:

  • Writes data received to a file

Purpose

Store data from a source in a file.

Main features

  • Flushing of data from memory is based on time since data received or amount of messages received
  • By default system newline is used, but can be altered
  • Multiple header lines allowed that used the set newline

Example

  <filecollectors>
    <file id="sensor" src="raw:test"> <!-- the id and the source of data -->
      <flush batchsize="10" period="15s"/> <!-- Write if 10 messages are received or the data is 15s old -->
      <rollover count="15" unit="min" zip="yes">HHmm</rollover> <!-- New file every 15minutes, {rollover} is replaced with calculated HHmm -->
      <path>csv/data_{rollover}.csv</path> <!-- file to write to with rollover -->
      <header>columnnames</header> <!-- header line -->
      <header>units</header> <!-- another header line -->
    </file>
  </filecollectors>
Clone this wiki locally