RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1515903 - virtual field \timestamp_ex missing in ausearch-expression man page
Summary: virtual field \timestamp_ex missing in ausearch-expression man page
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: audit
Version: 7.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Steve Grubb
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-21 15:08 UTC by Ondrej Moriš
Modified: 2018-10-30 11:29 UTC (History)
0 users

Fixed In Version: audit-2.8.4-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:28:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3237 0 None None None 2018-10-30 11:29:01 UTC

Description Ondrej Moriš 2017-11-21 15:08:31 UTC
Description of problem:

Three virtual fields are supported by ausearch expressions: \record_type, \timestamp and \timestamp_ex. However, only first two are documented in man page AUSEARCH-EXPRESSION(5).

Version-Release number of selected component (if applicable):

audit-2.8.1-1.el7

How reproducible:

100%

Steps to Reproduce:

1. man ausearch-expression

Actual results:

       \timestamp
              ...

       \record_type
              ...

Expected results:

       \timestamp
              ...

       \timestamp_ex
              ...

       \record_type
              ...


Additional info:

Reading man page, one might get false impression that any audit record field can be used in expression. I would be good to mention that only *uid and *gid fields are supported for now.

Comment 3 Steve Grubb 2018-03-28 19:41:53 UTC
Fixed in upstream commit 4dcbcd8. Turns out this feature never worked. Here's a simple program to exercise the functionality. You will need to adjust the timestamp to match what's in your log.

#include <stdio.h>
#include <stdlib.h>
#include <auparse.h>

#define LOG "./audit.log"

int main(void)
{
        int rc;
        char *error = NULL;
        const char *start_time = "ts:1208449363.116:3499";
        char expr[1024];
        auparse_state_t *au;

        au = auparse_init(AUSOURCE_FILE, LOG);
        if (au == NULL) {
                printf("master error\n");
                return 1;
        }
        snprintf(expr, sizeof(expr),
                "(\\timestamp_ex >= %s)",
                start_time);
        if (ausearch_add_expression(au, expr, &error, AUSEARCH_RULE_CLEAR)) {
                fprintf(stderr, "Criteria error: %s\n", error);
                free(error);
                return 1;
        }
        printf("Expression is OK\n");

        rc = ausearch_next_event(au);
        if (rc > 0)
                printf("Search is good\n");
        if (rc == 0)
                printf("Nothing found\n");
        if (rc < 0)
                printf("Error searching\n");

        auparse_destroy(au);
        return rc <= 0;
}

Comment 4 Steve Grubb 2018-06-20 14:00:30 UTC
audit-2.8.4-1.el7 was built to address this issue.

Comment 8 errata-xmlrpc 2018-10-30 11:28:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3237


Note You need to log in before you can comment on or make changes to this bug.