Hi Mariusz! Thanks for answering. inline commented
Mariusz Kruk via rsyslog <[email protected]> ezt írta (időpont: 2021. szept. 1., Sze, 14:23): > 1. As with dynamic files, rsyslog doesn't bother with rotating files and > any such maintenance (why should it? ;-)). Should or shouldn't I don't know. I used syslog-ng before, that rotated by default. So I asked before I re-invented the hot water. :-) > So you can create a template > that inserts entries into a dynamically named table but removing old > tables is entirely up to you. > How do you think the dynamically named table? Is there an example for it? The only problem, if I dinamically refer to a table, the table has to be exist. Should I create tables for a year forward if I want to log into different tables all days? > > 2. Just use a separate ruleset logging into a postgresql database and > tie it to the input on port 514. Like (very simple exapmple) > > ruleset(name="log_to_pg") { > action(type="ompgsql" [...]) > } > > input(type="imptcp" port="5514" ruleset="log_to_pg") > > Yes, I use a similar ruleset. But local messages are mixed with remote ones. I saw in the documentation there are filtering capabilities in the config, so I thought send only the messages from outside (from a specified host, or through the 5514). But I found only filtering examples based on message content: for example: if $msg contains 'error' then /var/log/errlog but not on source host. Is there any documentation what kind of internal variables (as $msg in the example) can I use in filter? > On 01.09.2021 14:14, Istvan Kassai via rsyslog wrote: > > Hi folks! > > > > I'm new on this list, and would like to ask two questions I can't solve. > > I have to collect logs into a postgres db table. It already works. The 2 > > problems occured: > > 1, How can I rotate log tables? Is there an inbuilt solution to rename > log > > table at every midnights, or I have to do it from outside with a cron > > script? > > 2, Every messages are logged into the database. I want to log local > > messages to be logged as before into files, and ONLY the remotely > generated > > messages to be written into database. I configured tcp/5514 port for it, > > and when I try it with "logger -P 5514 MESSAGETEXT" I can see in the > table. > > So if a message comes in through the tcp/5514 go to the database, every > > other to the files as before. > > > > thanks a lot > > Istvan > > _______________________________________________ > > rsyslog mailing list > > https://lists.adiscon.net/mailman/listinfo/rsyslog > > http://www.rsyslog.com/professional-services/ > > What's up with rsyslog? Follow https://twitter.com/rgerhards > > NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad > of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you > DON'T LIKE THAT. > _______________________________________________ > rsyslog mailing list > https://lists.adiscon.net/mailman/listinfo/rsyslog > http://www.rsyslog.com/professional-services/ > What's up with rsyslog? Follow https://twitter.com/rgerhards > NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad > of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you > DON'T LIKE THAT. _______________________________________________ rsyslog mailing list https://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/ What's up with rsyslog? Follow https://twitter.com/rgerhards NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.

