Closed GoogleCodeExporter closed 9 years ago
Sure, you can make that change with no problems. R_UNIXTIME is defaulted
because it is guaranteed to be correct (cannot be misparsed or tampered with).
The import script uses S_UNIXTIME already, so this is well tested. If you want
to make the manual change, you should add the following to /etc/elsa_vars.sh:
USE_LOCAL_SYSLOG_NG_CONF="1"
Put the new template to your local customizations file
(/etc/elsa_syslog-ng.conf) to ensure that your changes will be preserved across
upgrades to the node.
Original comment by mchol...@gmail.com
on 27 Feb 2013 at 4:25
That's great news, thanks a lot!
Original comment by rhatu...@gmail.com
on 27 Feb 2013 at 6:36
Sorry, I'm back with some doubts. I was going through the code to understand
the impact of this change, and I can use your help to double check something. I
had the impression that at some point ELSA was using the timestamps in a query,
and found this code:
$query = sprintf("SELECT MIN(id) AS min_id, MAX(id) AS max_id FROM %s", $full_table);
$sth = $self->db->prepare($query);
$sth->execute();
my $row = $sth->fetchrow_hashref;
($min, $max) = ($row->{min_id}, $row->{max_id});
$query = sprintf("SELECT FROM_UNIXTIME(timestamp) AS timestamp FROM %s WHERE id=?",
$full_table);
$sth = $self->db->prepare($query);
$sth->execute($min);
$row = $sth->fetchrow_hashref;
$start = $row->{timestamp};
$sth->execute($max);
$row = $sth->fetchrow_hashref;
$end = $row->{timestamp};
Now, I'm not sure this is truly a problem, from just from here I understand
that ELSA is assuming the min_id would be the oldest timestamp and that max_id
would be the newest event.
If we start using S_UNIXTIME, this scenario is no longer valid... or not? :-)
Thanks!
Original comment by rhatu...@gmail.com
on 27 Feb 2013 at 6:55
This is a fair point. I've just released code that will address this by
always tracking the earliest/latest timestamps for a batch and updating the
directory appropriately.
On Wed, Feb 27, 2013 at 12:55 PM, <
enterprise-log-search-and-archive@googlecode.com> wrote:
Original comment by mchol...@gmail.com
on 27 Feb 2013 at 9:28
Original issue reported on code.google.com by
rhatu...@gmail.com
on 27 Feb 2013 at 12:04