Skip to content

Commit f5110da

Browse files
committed
change command name to fluent-tailcheck
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent bf8ce2a commit f5110da

14 files changed

Lines changed: 61 additions & 61 deletions

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# tailcheck
1+
# fluent-tailcheck
22

3-
`tailcheck` is a command for [Fluentd](https://www.fluentd.org/).
3+
`fluent-tailcheck` is a command for [Fluentd](https://www.fluentd.org/).
44

55
This command checks whether [in_tail](https://docs.fluentd.org/input/tail) plugin is collecting logs properly.
66
For example, this command verifies whether a known critical log missing issue is occurring.
@@ -18,9 +18,9 @@ This command allows you to check whether these issues are occurring on your Flue
1818

1919
## Requirements
2020

21-
| tailcheck | fluentd | td-agent | fluent-package |
22-
|--------------|---------|----------|----------------|
23-
| all versions | >= v1.0 | >= 3.1.1 | >= 5.0.0 |
21+
| fluent-tailcheck | fluentd | td-agent | fluent-package |
22+
|------------------|---------|----------|----------------|
23+
| all versions | >= v1.0 | >= 3.1.1 | >= 5.0.0 |
2424

2525
## Installation
2626

@@ -35,7 +35,7 @@ $ sudo fluent-gem install fluent-tail_checker
3535
Then, you can use the command as follows.
3636

3737
```console
38-
$ /opt/fluent/bin/tailcheck --help
38+
$ /opt/fluent/bin/fluent-tailcheck --help
3939
```
4040

4141
#### .msi (Windows)
@@ -49,7 +49,7 @@ $ fluent-gem install fluent-tail_checker
4949
Then, you can use the command as follows.
5050

5151
```console
52-
$ tailcheck --help
52+
$ fluent-tailcheck --help
5353
```
5454

5555
### For td-agent v4
@@ -63,7 +63,7 @@ $ sudo td-agent-gem install fluent-tail_checker
6363
Then, you can use the command as follows.
6464

6565
```console
66-
$ /opt/td-agent/bin/tailcheck --help
66+
$ /opt/td-agent/bin/fluent-tailcheck --help
6767
```
6868

6969
#### .msi (Windows)
@@ -77,7 +77,7 @@ $ td-agent-gem install fluent-tail_checker
7777
Then, you can use the command as follows.
7878

7979
```console
80-
$ tailcheck --help
80+
$ fluent-tailcheck --help
8181
```
8282

8383
### For td-agent v3
@@ -91,7 +91,7 @@ $ sudo td-agent-gem install fluent-tail_checker
9191
Then, you can use the command as follows.
9292

9393
```console
94-
$ /opt/td-agent/embedded/lib/ruby/gems/2.4.0/bin/tailcheck --help
94+
$ /opt/td-agent/embedded/lib/ruby/gems/2.4.0/bin/fluent-tailcheck --help
9595
```
9696

9797
#### .msi (Windows)
@@ -105,7 +105,7 @@ $ fluent-gem install fluent-tail_checker
105105
Then, you can use the command as follows.
106106

107107
```console
108-
$ tailcheck --help
108+
$ fluent-tailcheck --help
109109
```
110110

111111
### For your Ruby environment
@@ -117,55 +117,55 @@ $ gem install fluent-tail_checker
117117
Then, you can use the command as follows.
118118

119119
```console
120-
$ tailcheck --help
120+
$ fluent-tailcheck --help
121121
```
122122

123123
## Usage
124124

125125
### Help
126126

127127
```console
128-
$ tailcheck --help
128+
$ fluent-tailcheck --help
129129
```
130130

131131
### Version
132132

133133
```console
134-
$ tailcheck --version
134+
$ fluent-tailcheck --version
135135
```
136136

137137
### Check pos files
138138

139139
You can specify a path of a pos file to check:
140140

141141
```console
142-
$ tailcheck /var/log/td-agent/pos/secure
142+
$ fluent-tailcheck /var/log/td-agent/pos/secure
143143
```
144144

145145
You can specify multiple paths:
146146

147147
```console
148-
$ tailcheck /var/log/td-agent/pos/secure /var/log/td-agent/pos/message
148+
$ fluent-tailcheck /var/log/td-agent/pos/secure /var/log/td-agent/pos/message
149149
```
150150

151151
You can use wildcards:
152152

153153
```console
154-
$ tailcheck /var/log/td-agent/pos/*
154+
$ fluent-tailcheck /var/log/td-agent/pos/*
155155
```
156156

157157
If you use [follow_inodes](https://docs.fluentd.org/input/tail#follow_inodes), then you must specify `--follow-inodes` option.
158158
(If you have both settings that use `follow_inodes` and those that do not, please run the command separately.)
159159

160160
```console
161-
$ tailcheck --follow-inodes /var/log/td-agent/pos/secure
161+
$ fluent-tailcheck --follow-inodes /var/log/td-agent/pos/secure
162162
```
163163

164164
You can change the minimum ratio of collection of each target log file by specify `--ratio DECIMAL`.
165165
By default (`0.5`), the command detects log files that have not been collected up to 50% of the filesize.
166166

167167
```
168-
$ tailcheck --ratio 0.7 /var/log/td-agent/pos/secure
168+
$ fluent-tailcheck --ratio 0.7 /var/log/td-agent/pos/secure
169169
```
170170

171171
### Result example
@@ -253,14 +253,14 @@ Please consider updating Fluentd if you are using any version older than Fluentd
253253

254254
## Feature
255255

256-
`tailcheck` performs the following checks on the specified pos file.
256+
`fluent-tailcheck` performs the following checks on the specified pos file.
257257

258258
* duplication check
259259
* collection ratio check
260260

261261
### Duplication check
262262

263-
`tailcheck` checks whether there is any dulication in the specified pos files.
263+
`fluent-tailcheck` checks whether there is any dulication in the specified pos files.
264264

265265
The keys of watching pos entries in one pos file must be unique.
266266

@@ -276,9 +276,9 @@ Especially, the following log missing issue causes this duplication.
276276
277277
### Collection ratio check
278278

279-
`tailcheck` checks collection ratio of each watching pos entry.
279+
`fluent-tailcheck` checks collection ratio of each watching pos entry.
280280

281-
By default, `tailcheck` detects log files that have not been collected up to 50% of the filesize.
281+
By default, `fluent-tailcheck` detects log files that have not been collected up to 50% of the filesize.
282282
You can change this threshold by `--ratio` option.
283283
Please see `Usage` section for details.
284284

@@ -293,12 +293,12 @@ Especially, if the `in_tail` uses [follow_inodes](https://docs.fluentd.org/input
293293
294294
#### Limitation
295295

296-
`tailcheck` checks the sizes of logfiles based on the paths recorded in the pos files (except already unwatched pos entries).
296+
`fluent-tailcheck` checks the sizes of logfiles based on the paths recorded in the pos files (except already unwatched pos entries).
297297

298298
However, if using `--follow-inodes`, there is a restriction on which files can be checked.
299-
If using `--follow-inodes`, it is possible that `tailcheck` can not check the already rotated logfiles even if they are recorded in the pos files and are not unwatched yet.
299+
If using `--follow-inodes`, it is possible that `fluent-tailcheck` can not check the already rotated logfiles even if they are recorded in the pos files and are not unwatched yet.
300300
Since the path recorded in the pos file is not updated after log rotation, the current path and inode may differ.
301-
`tailcheck` checks only log files whose path and inode in the pos file match.
301+
`fluent-tailcheck` checks only log files whose path and inode in the pos file match.
302302
At least, it can check the current log files.
303303

304304
If not using `--follow-inodes`, this limitation does not exist.
@@ -309,9 +309,9 @@ If not using `--follow-inodes`, this limitation does not exist.
309309

310310
```console
311311
$ bundle
312-
$ bundle exec exe/tailcheck --version
313-
$ bundle exec exe/tailcheck --help
314-
$ bundle exec exe/tailcheck test/data/pos_duplicate_unwatched_path
312+
$ bundle exec exe/fluent-tailcheck --version
313+
$ bundle exec exe/fluent-tailcheck --help
314+
$ bundle exec exe/fluent-tailcheck test/data/pos_duplicate_unwatched_path
315315
```
316316

317317
### Unit test
File renamed without changes.

lib/fluent/tail_checker/tail_check.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ def parse_command_line(argv)
3939
parser = OptionParser.new
4040
parser.version = VERSION
4141
parser.banner = <<~BANNER
42-
Usage: tailcheck [OPTIONS] POS_FILE...
43-
Example: tailcheck /path/to/pos1 /path/to/pos2
44-
Example: tailcheck /path/to/pos/*
45-
Example: tailcheck --follow-inodes /path/to/pos_with_follow_inodes
42+
Usage: fluent-tailcheck [OPTIONS] POS_FILE...
43+
Example: fluent-tailcheck /path/to/pos1 /path/to/pos2
44+
Example: fluent-tailcheck /path/to/pos/*
45+
Example: fluent-tailcheck --follow-inodes /path/to/pos_with_follow_inodes
4646
4747
If you have any issues with this command, please report it to https://github.com/clear-code/fluent-tail_checker/issues.
4848

test/script/command-test.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -exu
44

5-
tailcheck --version
6-
tailcheck --help
7-
tailcheck test/data/pos_normal
8-
(! tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path)
9-
tailcheck --follow-inodes test/data/pos_follow_inodes_normal
5+
fluent-tailcheck --version
6+
fluent-tailcheck --help
7+
fluent-tailcheck test/data/pos_normal
8+
(! fluent-tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path)
9+
fluent-tailcheck --follow-inodes test/data/pos_follow_inodes_normal

test/script/command-test.bat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@echo on
2-
call tailcheck --version || exit /b 1
2+
call fluent-tailcheck --version || exit /b 1
33

44
@echo on
5-
call tailcheck --help || exit /b 1
5+
call fluent-tailcheck --help || exit /b 1
66

77
@echo on
8-
call tailcheck test/data/pos_normal || exit /b 1
8+
call fluent-tailcheck test/data/pos_normal || exit /b 1
99

1010
@echo on
11-
call tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path && exit /b 1
11+
call fluent-tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path && exit /b 1
1212

1313
@echo on
14-
call tailcheck --follow-inodes test/data/pos_follow_inodes_normal || exit /b 1
14+
call fluent-tailcheck --follow-inodes test/data/pos_follow_inodes_normal || exit /b 1

test/script/fluent-package-v5.0.1.el9-test.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sudo dnf install -y ./fluent-package-5.0.1-1.el9.x86_64.rpm
77

88
sudo fluent-gem install /vagrant/pkg/*
99

10-
tailcheck=/opt/fluent/bin/tailcheck
10+
tailcheck=/opt/fluent/bin/fluent-tailcheck
1111

1212
$tailcheck --version
1313
$tailcheck --help

test/script/fluent-package-v5.0.1.jammy-test.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sudo apt install -y ./fluent-package_5.0.1-1_amd64.deb
77

88
sudo fluent-gem install /vagrant/pkg/*
99

10-
tailcheck=/opt/fluent/bin/tailcheck
10+
tailcheck=/opt/fluent/bin/fluent-tailcheck
1111

1212
$tailcheck --version
1313
$tailcheck --help

test/script/fluent-package-v5.0.1.msi-test.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function Test-Cmd([string]$Cmd, [switch]$ExpectFail) {
2323
}
2424

2525
Test-Cmd "fluent-gem install pkg/*"
26-
Test-Cmd "tailcheck --version"
27-
Test-Cmd "tailcheck --help"
28-
Test-Cmd "tailcheck test/data/pos_normal"
29-
Test-Cmd "tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path" -ExpectFail
26+
Test-Cmd "fluent-tailcheck --version"
27+
Test-Cmd "fluent-tailcheck --help"
28+
Test-Cmd "fluent-tailcheck test/data/pos_normal"
29+
Test-Cmd "fluent-tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path" -ExpectFail
3030

3131
exit 0

test/script/td-agent-v3.1.1.el7-test.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sudo yum install -y ./td-agent-3.1.1-0.el7.x86_64.rpm
1212

1313
sudo td-agent-gem install /vagrant/pkg/*
1414

15-
tailcheck=/opt/td-agent/embedded/lib/ruby/gems/2.4.0/bin/tailcheck
15+
tailcheck=/opt/td-agent/embedded/lib/ruby/gems/2.4.0/bin/fluent-tailcheck
1616

1717
$tailcheck --version
1818
$tailcheck --help

test/script/td-agent-v3.1.1.msi-test.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function Test-Cmd([string]$Cmd, [switch]$ExpectFail) {
2323
}
2424

2525
Test-Cmd "fluent-gem install pkg/*"
26-
Test-Cmd "tailcheck --version"
27-
Test-Cmd "tailcheck --help"
28-
Test-Cmd "tailcheck test/data/pos_normal"
29-
Test-Cmd "tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path" -ExpectFail
26+
Test-Cmd "fluent-tailcheck --version"
27+
Test-Cmd "fluent-tailcheck --help"
28+
Test-Cmd "fluent-tailcheck test/data/pos_normal"
29+
Test-Cmd "fluent-tailcheck test/data/pos_normal test/data/pos_duplicate_unwatched_path" -ExpectFail
3030

3131
exit 0

0 commit comments

Comments
 (0)