[GH-ISSUE #97] Regex in the name of the log file #74

Closed
opened 2026-02-26 05:31:14 +03:00 by kerem · 2 comments
Owner

Originally created by @Dual-Boot on GitHub (Oct 28, 2013).
Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/97

Hi,

I would know if harvester.conf file supports regex into logStreams.
For example I have an application creating a log file evry day with date at the end of the log file name.
So I would match not exactly the log file name but for example something like that : /opt/app_dir/log/access_log.*
Because every log are like these :
40K Sep 28 01:50 log/access_log.2013-09-27
53K Sep 29 01:50 log/access_log.2013-09-28
40K Sep 30 01:50 log/access_log.2013-09-29
80K Oct 1 01:50 log/access_log.2013-09-30
40K Oct 2 01:50 log/access_log.2013-10-01
109K Oct 3 01:50 log/access_log.2013-10-02
92K Oct 4 01:50 log/access_log.2013-10-03
110K Oct 5 01:50 log/access_log.2013-10-04
58K Oct 6 01:50 log/access_log.2013-10-05
40K Oct 7 01:50 log/access_log.2013-10-06
40K Oct 8 01:50 log/access_log.2013-10-07
51K Oct 9 01:50 log/access_log.2013-10-08
40K Oct 10 01:50 log/access_log.2013-10-09
142K Oct 11 01:50 log/access_log.2013-10-10
108K Oct 12 01:50 log/access_log.2013-10-11
79K Oct 13 01:55 log/access_log.2013-10-12
69K Oct 14 01:50 log/access_log.2013-10-13
86K Oct 15 01:50 log/access_log.2013-10-14
75K Oct 16 01:50 log/access_log.2013-10-15
40K Oct 17 01:50 log/access_log.2013-10-16
40K Oct 18 01:50 log/access_log.2013-10-17
40K Oct 19 01:50 log/access_log.2013-10-18
40K Oct 20 01:50 log/access_log.2013-10-19
40K Oct 21 01:50 log/access_log.2013-10-20
40K Oct 22 01:50 log/access_log.2013-10-21
40K Oct 23 01:50 log/access_log.2013-10-22
95K Oct 24 01:50 log/access_log.2013-10-23
49K Oct 25 01:50 log/access_log.2013-10-24
40K Oct 26 01:50 log/access_log.2013-10-25
94K Oct 27 01:50 log/access_log.2013-10-26
92K Oct 28 00:50 log/access_log.2013-10-27
49K Oct 28 16:30 log/access_log.2013-10-28

Any idea ?

Thank you for helping.

Originally created by @Dual-Boot on GitHub (Oct 28, 2013). Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/97 Hi, I would know if harvester.conf file supports regex into logStreams. For example I have an application creating a log file evry day with date at the end of the log file name. So I would match not exactly the log file name but for example something like that : /opt/app_dir/log/access_log.* Because every log are like these : 40K Sep 28 01:50 log/access_log.2013-09-27 53K Sep 29 01:50 log/access_log.2013-09-28 40K Sep 30 01:50 log/access_log.2013-09-29 80K Oct 1 01:50 log/access_log.2013-09-30 40K Oct 2 01:50 log/access_log.2013-10-01 109K Oct 3 01:50 log/access_log.2013-10-02 92K Oct 4 01:50 log/access_log.2013-10-03 110K Oct 5 01:50 log/access_log.2013-10-04 58K Oct 6 01:50 log/access_log.2013-10-05 40K Oct 7 01:50 log/access_log.2013-10-06 40K Oct 8 01:50 log/access_log.2013-10-07 51K Oct 9 01:50 log/access_log.2013-10-08 40K Oct 10 01:50 log/access_log.2013-10-09 142K Oct 11 01:50 log/access_log.2013-10-10 108K Oct 12 01:50 log/access_log.2013-10-11 79K Oct 13 01:55 log/access_log.2013-10-12 69K Oct 14 01:50 log/access_log.2013-10-13 86K Oct 15 01:50 log/access_log.2013-10-14 75K Oct 16 01:50 log/access_log.2013-10-15 40K Oct 17 01:50 log/access_log.2013-10-16 40K Oct 18 01:50 log/access_log.2013-10-17 40K Oct 19 01:50 log/access_log.2013-10-18 40K Oct 20 01:50 log/access_log.2013-10-19 40K Oct 21 01:50 log/access_log.2013-10-20 40K Oct 22 01:50 log/access_log.2013-10-21 40K Oct 23 01:50 log/access_log.2013-10-22 95K Oct 24 01:50 log/access_log.2013-10-23 49K Oct 25 01:50 log/access_log.2013-10-24 40K Oct 26 01:50 log/access_log.2013-10-25 94K Oct 27 01:50 log/access_log.2013-10-26 92K Oct 28 00:50 log/access_log.2013-10-27 49K Oct 28 16:30 log/access_log.2013-10-28 Any idea ? Thank you for helping.
kerem closed this issue 2026-02-26 05:31:15 +03:00
Author
Owner

@Dual-Boot commented on GitHub (Oct 28, 2013):

This kind of command works alone :
less /opt/app_dirlog/access_log.date +%F

But date +%F is not interpreted into conf file. I must precise that I am not node.js dev ;-)

<!-- gh-comment-id:27236037 --> @Dual-Boot commented on GitHub (Oct 28, 2013): This kind of command works alone : less /opt/app_dirlog/access_log.`date +%F` But `date +%F` is not interpreted into conf file. I must precise that I am not node.js dev ;-)
Author
Owner

@msmathers commented on GitHub (Nov 5, 2013):

The harvester uses node's fs.watch() to monitor file changes:
http://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener

It does not accept a regex, only a file or directory path. I've never tested it using a directory, you could try that... Otherwise I'd recommend using a separate process to concatenate logs into a single file.

<!-- gh-comment-id:27817537 --> @msmathers commented on GitHub (Nov 5, 2013): The harvester uses node's fs.watch() to monitor file changes: http://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener It does not accept a regex, only a file or directory path. I've never tested it using a directory, you could try that... Otherwise I'd recommend using a separate process to concatenate logs into a single file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/log.io-NarrativeScience-old#74
No description provided.