liveBook · Manning

CSV

As explained in Logs and Telemetry

CSV is a delimited text format that represents records as rows of values separated by a configurable delimiter.

CSV is a delimited text format for writing log records as rows of values. Its delimiter is configurable, so output can use commas, spaces, or tabs. section 5.5

Use CSV when file output needs compact values without field labels:

  • The output process writes the record's root values; nested JSON is emitted as a single value. section 5.5
  • Compare CSV with LTSV when labels are required, or with plain, MessagePack, and template output for other file representations. section 5.5

Tab-delimited file output

Configure Fluent Bit's file output with format csv and delimiter \t to write records to output1.csv. Matching output plugins can receive the same events simultaneously. section 5.5

Listing 5.5 Different file formats: simple-file.conf
[SERVICE]
  flush 1
  log_level error

[INPUT]
  name http    
  listen 0.0.0.0
  port 9881
  tag http-in

[OUTPUT]        #1
  match *
  name stdout
  json_date_key received-date
  json_date_format iso8601
  format json_lines




[OUTPUT]
  match *
  name file       #2
  file output1.csv          #3
  format csv        #4
  delimiter \t      #5

[OUTPUT]
  match *
  name file
  file output1.ltsv
  format ltsv          #6
  label_delimiter space       #7
  delimiter comma           #8

[OUTPUT]
  match *
  name file
  file output1.txt
  format plain

[OUTPUT]
  match *
  name file
  file output1.msgpack
  format msgpack           #9

[OUTPUT]
  match *
  name file
  format template           #10
  file output1.templated.txt
  template addressing={hello} value={val} --- {time}     #11

Inspect the complete configuration alongside JSON-lines, LTSV, plain, MessagePack, and template outputs. section 5.5

How Logs and Telemetry covers it

How deep it goes
Defines delimiters and nested-value handling, but stops short of quoting, escaping, or schema rules.
Examples
Demonstrates a tab-delimited output1.csv file configured through Fluent Bit's file output plugin.
What it assumes
Assumes familiarity with log records, output plugins, matching, and basic Fluent Bit configuration.
What you can do after
Configure CSV file output with a selected delimiter and route matching log events to it.
How it connects
Contrasts CSV with LTSV, plain text, MessagePack, template output, and JSON-lines formatting.

Also explained in

Compare how 15 books explain CSV →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.