query syntax example for opr-export-events

1 Likes

The command syntax is as follows:

/opt/HP/BSM/opr/support/opr-export-events.sh -o <output directory> -q "query=<event query>" -v -format 

The event query parameter can be any valid OQL expression that filters the events based on their attributes. You can use logical operators (AND, OR, NOT), comparison operators (EQ, NE, GT, LT, GE, LE), and wildcards (*, ?) to construct complex queries. You can also specify the time format for the time_created attribute using the ISO 8601 standard.

Here are some examples of event queries and their corresponding CLI commands:

- To export all events with severity minor:

/opt/HP/BSM/opr/support/opr-export-events.sh -o /tmp/exports -q "query=severity EQ 'minor'" -v -format 

- To export all events with severity critical and created after July 27, 2023, 6:00 AM UTC:

/opt/HP/BSM/opr/support/opr-export-events.sh  -q "query=severity+EQ+'critical'+AND+time_created+GT+2023-07-27T06:00:00Z" -o /tmp/exports  -v -format 

To export all events created after July 26, 2023:

/opt/HP/BSM/opr/support/opr-export-events.sh -o /tmp/exports  -q "query=time_created>2023-07-26T00:00:00.000-04:00" -v -format

To export all events created after July 26, 2023 and before July 30 2023:

/opt/HP/BSM/opr/support/opr-export-events.sh -o /tmp/exports  -q "query=time_created>2023-07-26T00:00:00.000-04:00 AND time_created<2023-07-30T00:00:00.000-04:00" -v -format

The official documentation for this command can be found here: https://docs.microfocus.com/doc/Operations_Bridge_Manager/2023.05/Clioprexportevents

Labels:

Knowledge Docs
Support Tip
Comment List
Related
Recommended