supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* s6-log problem with +regex
@ 2019-05-10  1:02 Dewayne Geraghty
  2019-05-10  2:27 ` Guillermo
  2019-05-10  2:38 ` Laurent Bercot
  0 siblings, 2 replies; 5+ messages in thread
From: Dewayne Geraghty @ 2019-05-10  1:02 UTC (permalink / raw)
  To: supervision

Thank-you for s6-rc and friends.  I came across two items:
1. the s6-log in testing requires a control directive. In my testing
without a T, t, n $VALUE for example, the s6-log command failed.
2. The regular expression preceded by a + unintentionally matches
everything, which was surprising as I intended to maintain separate logs
 which emanated from the same process (apache24)

So to testing.  My test comprised an input /tmp/af with the intention of
four separate s6-log managed logdirs. The logdirs' structure was
correctly created, however three contained the same content, and the
default contained nothing.  So the reduced form of testing looks like this:
# cat /tmp/af   # a file of text to be processed
a line of text not selected
b nother line of text
c more lines
[date] with line of text

The intention is to create a separate log based on a regex of the first
character.  Unfortunately the selection mechanism failed and the entire
content of the test file (/tmp/af) was duplicated, ie unselectively.

The following places the content of /tmp/af into /tmp/date-only.

#!/usr/local/bin/execlineb -P ; # The testing script
redirfd -r 0 /tmp/af
/usr/local/bin/s6-log -b n3 +^\\\[ /tmp/date-only  f s100 S1500 T
/tmp/default

The following works correctly, in that date-only does not contain the
[date] line.  It does contain the rest of /tmp/af, while /tmp/default
does contain only the date (input line).

# cat s6-test.sh
#!/usr/local/bin/execlineb -P
redirfd -r 0 /tmp/af
/usr/local/bin/s6-log -b n3 -^\\\[ /tmp/date-only  f s100 S1500 T
/tmp/default

Incidentally using the s6-log command
/usr/local/bin/s6-log -b n3 +^\\\[ /tmp/date-only  s10 S150 T +^b
/tmp/b-only  f s100 S1500 T /tmp/default
results in both
/tmp/date-only/current and /tmp/b-only/current
containing all of /tmp/af, /tmp/default had the expected structure but
empty current file.

The platform is amd64 FreeBSD 11.2Stable built May 6, clang v7.0.0 and
clang 8.0.0

PS I haven't made sense of the hyphen in the example, after "E500 - " on
page https://www.skarnet.org/software/s6/s6-log.html.  Testing resulted in
s6-log: fatal: unrecognized directive: -


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-10 14:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10  1:02 s6-log problem with +regex Dewayne Geraghty
2019-05-10  2:27 ` Guillermo
2019-05-10  2:38 ` Laurent Bercot
2019-05-10  4:52   ` Dewayne Geraghty
2019-05-10 14:23     ` Laurent Bercot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).