Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^5: how to resolve IP's in an HTTPd that doesn't resolve them?

by afoken (Canon)
on Jun 14, 2018 at 07:31 UTC ( #1216614=note: print w/replies, xml ) Need Help??


in reply to Re^4: how to resolve IP's in an HTTPd that doesn't resolve them?
in thread how to resolve IP's in an HTTPd that doesn't resolve them?

it's interesting that Apache doesn't have, or choose the use of a pipe

I expect Apache to simply open the log file in append mode. That should also work with a named pipe (a.k.a. FIFO). mknod /var/log/httpd/access.log p should be sufficient. Apache writes to that pipe, and a resolver program reads from the pipe.

But Apache can do even better, see piped logs:

CustomLog "|/usr/local/bin/name-resolver foo bar baz" common

The shell can also be invoked, that should allow creating a second pipe for a rotating logger:

CustomLog "|$/usr/local/bin/name-resolver foo bar | /usr/local/bin/mul +tilog t s1000000 /var/multilog/apache" common

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^6: how to resolve IP's in an HTTPd that doesn't resolve them?
by taint (Chaplain) on Jun 14, 2018 at 14:24 UTC
    Thanks afoken !

    That's all pretty much as I had imagined the direction I'd need to go. But had hoped for something a little more fun, or elegant.
    Tho your suggestion is elegant in it's simplicity. Which is worth quite a bit, in my book. :-)

    Thanks again, Alexander!

    edit:
    Forgot to mention; yes. You are correct. As near as I can figure, Apache does write in append mode.

    edit II:
    Oh, and this ain't Apache I'm working with. But logging to a UNIX pipe is still valid. :-)
    and sorry for the additional edits. But I had a lot on my plate this AM, and I was a bit pressed for time. But by the same token, didn't want to let all the work go unacknowledged. :-)

    --Chris

    Evil is good, for without it, Good would have no value
    λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1216614]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-07-05 19:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?