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

Option to disable time portion of the path with out_file output #1407

Closed
gemyago opened this issue Jan 7, 2017 · 6 comments
Closed

Option to disable time portion of the path with out_file output #1407

gemyago opened this issue Jan 7, 2017 · 6 comments
Labels
document Improvements or additions to documentation enhancement Feature request or improve operations

Comments

@gemyago
Copy link

gemyago commented Jan 7, 2017

Hi,

Currently out_file will always append time to file name. It would be good to have an option to disable that so it'll always be writing to the same file. It's easier to find last log if it's path is not time sliced and it's easy to setup logrotate that will rotate the files in a more flexible way.

@repeatedly
Copy link
Member

@tagomoris How about this?

In v0.14, we can remove time slice with like below:

<match test.**>
  @type file
  path out/${tag}

  <buffer tag>
    flush_at_shutdown true
  </buffer>
  # ... other parameters
</match>

But default chunk_keys is ["time"], so we can't use <buffer> in the configuration.

@repeatedly repeatedly added the enhancement Feature request or improve operations label Jan 7, 2017
@tagomoris
Copy link
Member

As a quick hack, this configuration seems to work as expected (write all matched events into a file without time in path):

<match test.**>
  @type file
  path out/mytest
  append true
  <buffer []>
    flush_interval 5s
  </buffer>
</match>

It looks very hacky, but it might be better to add configuration parameter in out_file to control default chunk key if there are many requests for such configuration.

@gemyago
Copy link
Author

gemyago commented Jan 8, 2017

Hi @tagomoris,

Thanks, this hint works. Looks hacky agree, but it works so who cares :). Is there any documentation on this style of buffer config? I can't seems to find one...

@tagomoris
Copy link
Member

Unfortunately, these documentations are not written yet. I'll use this month for documentation tasks...

@gemyago
Copy link
Author

gemyago commented Jan 8, 2017

That's ok. I've found few bits here and there so have everything I need. Thanks for your help!

@tagomoris tagomoris added the document Improvements or additions to documentation label Jan 9, 2017
@repeatedly
Copy link
Member

Added to the document about <buffer []>.
Will be updated after heroku comes back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Improvements or additions to documentation enhancement Feature request or improve operations
Projects
None yet
Development

No branches or pull requests

3 participants