Events-csv User Manual

From NovaOrdis Knowledge Base
Revision as of 21:53, 22 September 2017 by Ovidiu (talk | contribs) (→‎headers)
Jump to navigation Jump to search

Internal

Overview

"csv" assumes that the input file or piped content is text comma-separated content and parses it, generating events, which then are optionally filtered by the query and processed depending on the command specified on command line.

csv [command] [query] <input-file.csv>

The default command, which does not need to be specified on the command line, is output: the CSV content is parsed and the resulted events are optionally filtered and displayed at stdout:

csv [query] [-o output-spec] <input-file.csv>

Alternatively, the content can be sent into "csv" with a pipe:

tail -f input.csv | csv [command] [query]

Concepts

events-csv Concepts

Commands

output

This is the default command, and does not need to be specified on the command line. More details about the output specification is available here:

output

headers

csv header|headers [--first|--last] ./sample.csv

Scan the CSV stream and display the headers, as they are identified in the stream. The command displays the header's line number, the timestamp of the event that immediately follows the header, and then:

  • the index that can be used to access the value that corresponds the header in a data lines. The index can be used for index-based output.
  • the header name.
  • the header type.
  • optionally, the header format.

Usage Example:

csv headers ./sample.csv

line 1 header, applies to events recorded on 12/01/16 00:00:00 and after:
  0: timestamp(time:MM/dd/yy HH:mm:ss)
  2: color(string)
  3: size(int)

Modifiers

--first

--last