Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out_file: support csv format #241

Merged
merged 1 commit into from
Apr 25, 2017
Merged

out_file: support csv format #241

merged 1 commit into from
Apr 25, 2017

Conversation

nokute78
Copy link
Collaborator

This PR is to support csv output file format.

I added new properties "format" and "delimiter".

example

configuration file is

[INPUT]
    Name mem
    Tag  mem.usage

[OUTPUT]
    Name file
    Match *
    Path  mem.csv

    Format csv
    #Delimiter \t

# filter_stdout to expose streaming data
[FILTER]
    Name stdout
    Match *
$ bin/fluent-bit -c file.conf 
Fluent-Bit v0.12.0
Copyright (C) Treasure Data

[2017/04/21 23:16:16] [ info] [engine] started
[0] mem.usage: [1492784177.002298028, {"Mem.total"=>3920464, "Mem.used"=>2001032, "Mem.free"=>1919432, "Swap.total"=>2064380, "Swap.used"=>0, "Swap.free"=>2064380}]
[0] mem.usage: [1492784178.000651208, {"Mem.total"=>3920464, "Mem.used"=>2001204, "Mem.free"=>1919260, "Swap.total"=>2064380, "Swap.used"=>0, "Swap.free"=>2064380}]
[0] mem.usage: [1492784179.001232752, {"Mem.total"=>3920464, "Mem.used"=>2001188, "Mem.free"=>1919276, "Swap.total"=>2064380, "Swap.used"=>0, "Swap.free"=>2064380}]
[0] mem.usage: [1492784180.003776752, {"Mem.total"=>3920464, "Mem.used"=>2001188, "Mem.free"=>1919276, "Swap.total"=>2064380, "Swap.used"=>0, "Swap.free"=>2064380}]
[0] mem.usage: [1492784181.001713812, {"Mem.total"=>3920464, "Mem.used"=>2001328, "Mem.free"=>1919136, "Swap.total"=>2064380, "Swap.used"=>0, "Swap.free"=>2064380}]
^C[engine] caught signal

The file is written like this.

$ cat mem.csv 
1492784177.002298,3920464,2001032,1919432,2064380,0,2064380
1492784178.000651,3920464,2001204,1919260,2064380,0,2064380
1492784179.001233,3920464,2001188,1919276,2064380,0,2064380
1492784180.003777,3920464,2001188,1919276,2064380,0,2064380

Signed-off-by: Takahiro YAMASHITA <[email protected]>
@edsiper edsiper merged commit 91a60e9 into fluent:master Apr 25, 2017
@edsiper
Copy link
Member

edsiper commented Apr 25, 2017

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants