Re: irssi logs variables?

Brandon McCaig <[email protected]> Thu, 22 Mar 2012 10:42:26 -0400
Newsgroups gmane.network.irc.irssi.user
Message-ID <[email protected]>
--ABTtc+pdwF7KHXCz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2012-03-16 19:46:16 +0100, Francesco de Virgilio wrote:
> Hi guys,

Hello:

> I'm using IRSSI with XMPP and GTalk, and logs are formatted as
> follows:
>=20
> autolog_path =3D "~/.irssi/logs/$tag/$0.%y-%m-%d.log"
>=20
> The problem is, it generates this log file when the user is connected
> from the web chat interface:
>=20
> [email protected]_gmail.8FCE4E05.12-02-19.log
>=20
> and the following log when the user is connected from Android client:
>=20
> [email protected]_android7245d601efb6.12-02-19.log
>=20
> So, log reading is really a mess. Moreover, the number after "gmail"
> and "android" seems to be assigned randomly from Google, and it can
> vary trough the time. So, for the same user I can have:
>=20
> [email protected]_gmail.G9GA6D06.11-12-19.log
> [email protected]_gmail.8FCE4E05.12-02-19.log
> [email protected]_android64w6d6895shf.12-02-19.log
> [email protected]_android7245d601efb6.12-02-19.log
>=20
> I'm searching for a way to truncate the user name in logs before
> the "_", creating a client-independent log file for the same user,
> like:
>=20
> [email protected]
>=20
> I've read the docs, googled until headache, but nothing. I'm using
> IRSSI 0.8.15 on Ubuntu 11.04.

It sounds like XMPP support comes from a plugin, and isn't a core
feature of irssi. Personally I use Bitlbee to access other IM
networks from irssi, such as GTalk. So my logs end up being in
~/.irssi/logs/bitlbee/${nick}.log. Perhaps changing to Bitlbee is
one option.

I'm not sure if either will work for you, but alternatively try
to find special_vars.txt distributed with irssi for a description
of variable expansion rules and the variables available for use.
*Maybe* $T would be a suitable replacement for $0, but I'm not
too confident.. You'll have to experiment with the variables in
that file to see if you can find something that works better for
you.

If that doesn't work then try /help log while running irssi for a
description of the /log command's usage. It sounds like you can
configure irssi to log particular nicks to a specific file, so
perhaps you could manually configure each of your GTalk contacts.
Untested example:

/log -targets bob ~/.irssi/logs/gtalk/bob.log

I don't know just how specific the target can be. It would
certainly suck if it also matched bobs on other networks and
logged them to your gtalk friend's log. You will have to
experiment to find out, I guess. Maybe it will accept masks?

Alternatively, it shouldn't be unreasonable to merge the logs
after the fact manually with a simple command or automatically
with a program. I'll leave this as an exercise to the reader
because I'm feeling lazy. ^^

Regards,


--=20
Brandon McCaig <[email protected]> <[email protected]>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bamccaig.com/>
perl -E '$_=3Dq{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'



--ABTtc+pdwF7KHXCz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJPazpSAAoJEN2n1gIi5ZPy9vcQALD2DI6agL2syD2KVRCObXSC
ooEqOFfyX1XbgomekrGy1U1i4XoxIPgTOysPcXwg5mqOj3bxR6+HigB1/sh+TIKM
bFpMH63aHOArH5wElQU4O/iAbpMbru5bSnoj298EAXSpoaDUXn0nGxEk/xzqaUJ9
bBC1KZaKg1Jzp39RDWtVr3s7bQm3ZXFEveAP+8Lox+AU8uyAX66LSA0RYRSFH13I
uUbs1X6S4qs3Yz6j0p5sWsMvHIqSLF2oPGZ6/Skegi+a6u2rOOzb1GiGNNgrKSDj
8Png4y0guhDmGLGrc0hWrRiRJppopDxfUP03RXU7BwaQuJ9DR7GWMphPfk6o7eS3
I81k9LH/VEdH9wclKWnmIt7tx+qBDUTSoFEKaajfIEQDT3Frck5gF0Nwzr0pE9h3
oJeSOhLICbf3wS2uxENlzb3C324Yr+MPj21/n2P+RWAQtFb67UuSX2FemYqexGeI
6/orIDr/6Wvlrhx1PAVwUUi9MUK+oix9LFHq9jT+23S3IKfoNYaaLo8ndbbntn9O
cz+8VSJrsfbLaDQnqlHC1FQtvdOeCfvtIxfVd6c376UP/RwdWjr7djwMQ+s9njgI
60y+Kz5ZBpl9cJQPYizCMxLKPAgV34jWmAzCLU3vyOs/1lOP7RX1ImLoNst7Midi
ThAu5Q15zglBMeqwc1lF
=O37z
-----END PGP SIGNATURE-----

--ABTtc+pdwF7KHXCz--