Skip to content

Commit c3990c9

Browse files
committed
README: separate files
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent c7ba6b8 commit c3990c9

6 files changed

Lines changed: 280 additions & 266 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/.yardoc
33
/_yardoc/
44
/coverage/
5-
/doc/
65
/pkg/
76
/spec/reports/
87
/tmp/

README.md

Lines changed: 9 additions & 265 deletions
Original file line numberDiff line numberDiff line change
@@ -24,101 +24,10 @@ This command allows you to check whether these issues are occurring on your Flue
2424

2525
## Installation
2626

27-
### fluent-package
28-
29-
#### RPM/DEB (Linux)
30-
31-
```console
32-
$ sudo fluent-gem install fluent-tail_checker
33-
```
34-
35-
Then, you can use the command as follows.
36-
37-
```console
38-
$ /opt/fluent/bin/fluent-tailcheck --help
39-
```
40-
41-
#### .msi (Windows)
42-
43-
`Fluent Package Command Prompt` with Administrator privilege:
44-
45-
```console
46-
$ fluent-gem install fluent-tail_checker
47-
```
48-
49-
Then, you can use the command as follows.
50-
51-
```console
52-
$ fluent-tailcheck --help
53-
```
54-
55-
### For td-agent v4
56-
57-
#### RPM/DEB (Linux)
58-
59-
```console
60-
$ sudo td-agent-gem install fluent-tail_checker
61-
```
62-
63-
Then, you can use the command as follows.
64-
65-
```console
66-
$ /opt/td-agent/bin/fluent-tailcheck --help
67-
```
68-
69-
#### .msi (Windows)
70-
71-
`Td-agent Command Prompt` with Administrator privilege:
72-
73-
```console
74-
$ td-agent-gem install fluent-tail_checker
75-
```
76-
77-
Then, you can use the command as follows.
78-
79-
```console
80-
$ fluent-tailcheck --help
81-
```
82-
83-
### For td-agent v3
84-
85-
#### RPM/DEB (Linux)
86-
87-
```console
88-
$ sudo td-agent-gem install fluent-tail_checker
89-
```
90-
91-
Then, you can use the command as follows.
92-
93-
```console
94-
$ /opt/td-agent/embedded/lib/ruby/gems/2.4.0/bin/fluent-tailcheck --help
95-
```
96-
97-
#### .msi (Windows)
98-
99-
`Td-agent Command Prompt` with Administrator privilege:
100-
101-
```console
102-
$ fluent-gem install fluent-tail_checker
103-
```
104-
105-
Then, you can use the command as follows.
106-
107-
```console
108-
$ fluent-tailcheck --help
109-
```
110-
111-
### For your Ruby environment
112-
113-
```console
114-
$ gem install fluent-tail_checker
115-
```
116-
117-
Then, you can use the command as follows.
118-
119-
```console
120-
$ fluent-tailcheck --help
121-
```
27+
* [fluent-package](doc/installation.md#fluent-package)
28+
* [td-agent v4](doc/installation.md#td-agent-v4)
29+
* [td-agent v3](doc/installation.md#td-agent-v3)
30+
* [Your Ruby environment](doc/installation.md#your-ruby-environment)
12231

12332
## Usage
12433

@@ -163,6 +72,7 @@ $ fluent-tailcheck --follow-inodes /var/log/td-agent/pos/secure
16372

16473
You can change the minimum ratio of collection of each target log file by specify `--ratio DECIMAL`.
16574
By default (`0.5`), the command detects log files that have not been collected up to 50% of the filesize.
75+
Please see [Collection ratio check](doc/feature.md#collection-ratio-check) for details.
16676

16777
```
16878
$ fluent-tailcheck --ratio 0.7 /var/log/td-agent/pos/secure
@@ -178,183 +88,17 @@ Please use `sudo` (on Linux-like) or a terminal with administrative privileges (
17888
$ sudo fluent-tailcheck /var/log/td-agent/pos/secure
17989
```
18090

181-
### Result example
182-
183-
#### No anomalies found
184-
185-
```
186-
Check /path/to/pos.
187-
Done duplication check for 2 PosEntries.
188-
Done collection ratio check for 2 files.
189-
190-
All check completed. (Fluentd v1.15.0)
191-
There is no anomalies.
192-
```
193-
194-
This means:
195-
196-
* The command has checked `/path/to/pos`.
197-
* The command has checked 2 pos entries for duplication check.
198-
* The command has checked 2 files for collection ratio check.
199-
* It is detected that the version of your Fluentd is v1.15.0.
200-
* There is no anomalies.
201-
202-
#### Pos duplication found
203-
204-
```
205-
Check /path/to/pos.
206-
Done duplication check for 3 PosEntries.
207-
Duplicated PosEntries are found. This is a known log missing issue that was fixed in Fluentd v1.16.3 (fluent-package v5.0.2, td-agent v4.5.2). If you are using any version older than these, updating Fluentd will resolve the issue.
208-
Duplicated paths:
209-
/test/foo.log
210-
Done collection ratio check for 0 files.
211-
212-
All check completed. (Fluentd v1.15.0)
213-
Some anomalies are found. Please check the logs for details.
214-
If you have any questions or issues, please report them to the following:
215-
Fluentd Q&A: https://github.com/fluent/fluentd/discussions/categories/q-a
216-
Fluentd Q&A (日本語用): https://github.com/fluent/fluentd/discussions/categories/q-a-japanese
217-
About this command (日本語可): https://github.com/clear-code/fluent-tail_checker/issues
218-
```
219-
220-
In this case, some the pos entries are duplicated.
221-
It is a known log missing issue that was fixed in Fluentd v1.16.3.
222-
223-
> * https://github.com/fluent/fluentd/issues/3614
224-
> * In case `follow_inodes false` (default setting), collection of a file may stop and continue to stop after log rotation.
225-
> * Fixed since Fluentd v1.16.3 (fluent-package v5.0.2, td-agent v4.5.2).
91+
### Result examples
22692

227-
So, you should check whether there is any log missing, and consider updating Fluentd, especially, if you are using any version older than Fluentd v1.16.3 (fluent-package v5.0.2, td-agent v4.5.2).
228-
229-
#### Too low collection ratio file found
230-
231-
```
232-
Check /path/to/pos.
233-
Done duplication check for 2 PosEntries.
234-
Done collection ratio check for 2 files.
235-
Collection ratio of some files are too low. Collection of those files may not be keeping up. Or it may have stopped with some anomalies. This can be a known log missing issue of the follow_inodes feature that was fixed in Fluentd v1.16.2 (fluent-package v5.0.0, td-agent v4.5.1). If you are using any version older than these, updating Fluentd will resolve the issue.
236-
Filepaths with too low collection ratio (threshold: 0.5):
237-
/test/bar.log (ratio: 0.2)
238-
/test/foo.log (ratio: 0.1)
239-
240-
All check completed. (Fluentd v1.15.0)
241-
Some anomalies are found. Please check the logs for details.
242-
If you have any questions or issues, please report them to the following:
243-
Fluentd Q&A: https://github.com/fluent/fluentd/discussions/categories/q-a
244-
Fluentd Q&A (日本語用): https://github.com/fluent/fluentd/discussions/categories/q-a-japanese
245-
About this command (日本語可): https://github.com/clear-code/fluent-tail_checker/issues
246-
```
247-
248-
In this case, collection ratio of some target files are too low.
249-
Collection of those files may have stopped or may not be keeping up.
250-
251-
> /test/bar.log (ratio: 0.2)
252-
253-
This means that only 20% of the data of the file is collected for the filesize.
254-
If it is not keeping up temporarily, then it is no problem.
255-
If this is always the case, or if collection has stopped completely, then log missing may occur.
256-
257-
Especially, if the `in_tail` uses [follow_inodes](https://docs.fluentd.org/input/tail#follow_inodes), there is a known log missing issue that was fixed in Fluentd v1.16.2.
258-
259-
> * https://github.com/fluent/fluentd/issues/4190
260-
> * In case `follow_inodes true`, collection of a file may stop and continue to stop after log rotation.
261-
> * Fixed since Fluentd v1.16.2 (fluent-package v5.0.0, td-agent v4.5.1).
262-
263-
Please consider updating Fluentd if you are using any version older than Fluentd v1.16.2 (td-agent v4.5.1).
93+
* [Result examples](doc/result-examples.md)
26494

26595
## Feature
26696

267-
`fluent-tailcheck` performs the following checks on the specified pos file.
268-
269-
* duplication check
270-
* collection ratio check
271-
272-
### Duplication check
273-
274-
`fluent-tailcheck` checks whether there is any dulication in the specified pos files.
275-
276-
The keys of watching pos entries in one pos file must be unique.
277-
278-
By default, the key is the path of the target log file.
279-
When using [follow_inodes](https://docs.fluentd.org/input/tail#follow_inodes), the key is the inode.
280-
281-
If duplication occurs, it means some anomalies occurs in that `in_tail`.
282-
Especially, the following log missing issue causes this duplication.
283-
284-
> * https://github.com/fluent/fluentd/issues/3614
285-
> * In case `follow_inodes false` (default setting), collection of a file may stop and continue to stop after log rotation.
286-
> * Fixed since Fluentd v1.16.3 (fluent-package v5.0.2, td-agent v4.5.2).
287-
288-
### Collection ratio check
289-
290-
`fluent-tailcheck` checks collection ratio of each watching pos entry.
291-
292-
By default, `fluent-tailcheck` detects log files that have not been collected up to 50% of the filesize.
293-
You can change this threshold by `--ratio` option.
294-
Please see `Usage` section for details.
295-
296-
If this it too low, collection of those files may not be keeping up.
297-
Or it may have stopped with some anomalies.
298-
299-
Especially, if the `in_tail` uses [follow_inodes](https://docs.fluentd.org/input/tail#follow_inodes), there is a known log missing issue that was fixed in Fluentd v1.16.2.
300-
301-
> * https://github.com/fluent/fluentd/issues/4190
302-
> * In case `follow_inodes true`, collection of a file may stop and continue to stop after log rotation.
303-
> * Fixed since Fluentd v1.16.2 (fluent-package v5.0.0, td-agent v4.5.1).
304-
305-
#### Limitation
306-
307-
`fluent-tailcheck` checks the sizes of logfiles based on the paths recorded in the pos files (except already unwatched pos entries).
308-
309-
However, if using `--follow-inodes`, there is a restriction on which files can be checked.
310-
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.
311-
Since the path recorded in the pos file is not updated after log rotation, the current path and inode may differ.
312-
`fluent-tailcheck` checks only log files whose path and inode in the pos file match.
313-
At least, it can check the current log files.
314-
315-
If not using `--follow-inodes`, this limitation does not exist.
97+
* [Feature](doc/feature.md)
31698

31799
## Development
318100

319-
### Quick start
320-
321-
```console
322-
$ bundle
323-
$ bundle exec exe/fluent-tailcheck --version
324-
$ bundle exec exe/fluent-tailcheck --help
325-
$ bundle exec exe/fluent-tailcheck test/data/pos_duplicate_unwatched_path
326-
```
327-
328-
### Unit test
329-
330-
```console
331-
$ bundle exec rake test
332-
```
333-
334-
### Package test
335-
336-
Need `Vagrant`.
337-
338-
```console
339-
$ vagrant status
340-
$ vagrant up {id}
341-
$ vagrant snapshot save {id} init
342-
$ vagrant ssh {id} -- /vagrant/test/script/{test-script}
343-
$ vagrant snapshot restore {id} init
344-
```
345-
346-
Example:
347-
348-
```console
349-
$ vagrant up centos-7
350-
$ vagrant snapshot save centos-7 init
351-
$ vagrant ssh centos-7 -- /vagrant/test/script/td-agent-v3.1.1.el7-test.bash
352-
$ vagrant snapshot restore centos-7 init
353-
```
354-
355-
### Install and release
356-
357-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
101+
* [Development](doc/development.md)
358102

359103
## Contributing
360104

doc/development.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Development
2+
3+
## Quick start
4+
5+
```console
6+
$ bundle
7+
$ bundle exec exe/fluent-tailcheck --version
8+
$ bundle exec exe/fluent-tailcheck --help
9+
$ bundle exec exe/fluent-tailcheck test/data/pos_duplicate_unwatched_path
10+
```
11+
12+
## Unit test
13+
14+
```console
15+
$ bundle exec rake test
16+
```
17+
18+
## Package test
19+
20+
Need `Vagrant`.
21+
22+
```console
23+
$ vagrant status
24+
$ vagrant up {id}
25+
$ vagrant snapshot save {id} init
26+
$ vagrant ssh {id} -- /vagrant/test/script/{test-script}
27+
$ vagrant snapshot restore {id} init
28+
```
29+
30+
Example:
31+
32+
```console
33+
$ vagrant up centos-7
34+
$ vagrant snapshot save centos-7 init
35+
$ vagrant ssh centos-7 -- /vagrant/test/script/td-agent-v3.1.1.el7-test.bash
36+
$ vagrant snapshot restore centos-7 init
37+
```
38+
39+
## Install and release
40+
41+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).

0 commit comments

Comments
 (0)