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

Filecount: Trailing slash in directories does not work #6329

Closed
jnguiot opened this issue Aug 29, 2019 · 0 comments · Fixed by #6332
Closed

Filecount: Trailing slash in directories does not work #6329

jnguiot opened this issue Aug 29, 2019 · 0 comments · Fixed by #6332
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@jnguiot
Copy link

jnguiot commented Aug 29, 2019

Relevant telegraf configuration:

[[inputs.filecount]]
	directories = ["/tmp/test/"]

System info:

  • Debian 9.9
  • Telegraf 1.11.5

Steps to reproduce:

  1. Create a test directory:
mkdir /tmp/test
touch /tmp/test/file{1,2,3,4}
  1. Create an input file (/tmp/input.conf)
[[inputs.filecount]]
	directories = ["/tmp/test/"]
  1. Execute it:
test@example:/tmp# telegraf --config input.conf --test
2019-08-29T12:04:33Z I! Starting Telegraf 1.11.5
test@example:/tmp#

Expected output:
Command should return:

test@example:/tmp# telegraf --config input.conf --test
2019-08-29T12:05:41Z I! Starting Telegraf 1.11.5
> filecount,directory=/tmp/test/,host=backup count=4i,size_bytes=0i 1567080341000000000
test@example:/tmp# 

If we remove the trailing / in directories, it works fine.
It could be an expected behavior to process only directories without trailing slashes, but in this case, it would be great to emphasize it in documentation.

By the way, thank you for your work on telegraf, it is a great piece of software :)

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Aug 29, 2019
@danielnelson danielnelson self-assigned this Aug 29, 2019
@danielnelson danielnelson modified the milestones: 1.12.0, 1.12.1 Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants