From: Robert Riches on
On 2010-06-04, Rahul <nospam(a)nospam.invalid> wrote:
> I have two log files foo and bar which are updated continuously as user-
> jobs start and end. The ultimate logfile can be constructed by a join on a
> common keyword field in files foo and bar like so:
>
> join -t ';' -j 1 /tmp/foo /tmp/bar > /tmp/composite_log
>
> Is there a way to keep a always up-to-date composite_log without having to
> manually run the join command at intervals? I mean, I could cron the join
> command and get a composite_log with a fairly good granularity but that
> seems brute-force.
>
> Is there a way to somehow "tie" the file composite_log to the files foo and
> bar so that it will automatically update on any changes to foo / bar? I am
> reminded of a "view" in database paralance. Is there a similar construct
> for a "derived" file?

That sounds like a job for a Fuse plug-in.

--
Robert Riches
spamtrap42(a)verizon.net
(Yes, that is one of my email addresses.)
From: Rahul on
Robert Riches <spamtrap42(a)verizon.net> wrote in
news:slrni0jisj.vnh.spamtrap42(a)one.localnet:

> That sounds like a job for a Fuse plug-in.
>

Thanks Robert! I am looking into that. I have used splunk before but for
this particular problem that is somewhat like using a cannon to kile a
mouse.

Another thought I have is to use something like anacron that has a hook on
file changes and use that to trigger the join.

--
Rahul
From: Joe Beanfish on
On 06/06/10 17:44, Rahul wrote:
> Robert Riches<spamtrap42(a)verizon.net> wrote in
> news:slrni0jisj.vnh.spamtrap42(a)one.localnet:
>
>> That sounds like a job for a Fuse plug-in.
>>
>
> Thanks Robert! I am looking into that. I have used splunk before but for
> this particular problem that is somewhat like using a cannon to kile a
> mouse.
>
> Another thought I have is to use something like anacron that has a hook on
> file changes and use that to trigger the join.

Oh? That sounds interesting but I don't see any mention of that in
my anacron or anacrontab man pages.
I have cronie-anacron 1.4.3 on FC12 if it matters.

I've used a regular cron job with a find -newer timestampfile command
for similar activities before.
From: Rahul on
Joe Beanfish <joe(a)nospam.duh> wrote in news:hujan5
$4mk(a)news.thunderstone.com:

> Oh? That sounds interesting but I don't see any mention of that in
> my anacron or anacrontab man pages.
> I have cronie-anacron 1.4.3 on FC12 if it matters.
>

My bad! I meant to say "incron" not "anacron".

http://inotify.aiken.cz/?section=incron&page=about&lang=en

I was thinking this can run the join the moment either of the two logs are
modified.

--
Rahul
From: Chris Davies on
Rahul <nospam(a)nospam.invalid> wrote:
> I have two log files foo and bar which are updated continuously as user-
> jobs start and end. The ultimate logfile can be constructed by a join on a
> common keyword field in files foo and bar like so:

> join -t ';' -j 1 /tmp/foo /tmp/bar > /tmp/composite_log

> Is there a way to keep a always up-to-date composite_log without having to
> manually run the join command at intervals?

No (see other posts).

Is there a real need to maintain the composite log given that you have
the underlying originals? Perhaps you could more simply use a viewer
command that generates the composite on the fly.

Chris