get-event operation

The get-event operation retrieves events that are filtered by the specified search criterion.

The following table describes the <items> XML and request elements for the get-event operation:

Adapter request elements for the get-event operation

Element

Definition

Required

<operation-name>

Specifies the operation name: get-event

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<event-search-criteria>

Specifies the parent element for defining the search criterion

No

<criteria-expression>

Specifies the parent element for a single search criterion

You can specify more than one filter criterion by using multiple <criteria-expression> elements.

Conditional; required if the <event-search-criteria> element is specified

<key>

Specifies the event attribute used in the search

You can use the find-event-by-id operation to retrieve a list of all the event attributes.

Valid values:

  • Id
  • OriginalId
  • MonitoringObjectId
  • MonitoringClassId
  • MonitoringObjectName
  • MonitoringObjectDisplayName
  • MonitoringObjectPath
  • MonitoringObjectFullName
  • MonitoringRuleId
  • MonitoringRuleDisplayName
  • PublisherName
  • Number
  • Description
  • CategoryId
  • Category
  • User
  • Channel
  • LevelId
  • Level
  • LoggingComputer
  • EventData
  • Parameters
  • ManagementGroup
  • ManagementGroupId

Conditional; required if the <event-search-criteria> element is specified

<value>

Specifies the value of the attribute specified in the <key> element

Conditional; required if the <event-search-criteria> element is specified

<isrecurse>

Determines whether to retrieve events for contained monitoring objects or only for the current monitoring object

Valid values: true, false

Conditional; optional if the <event-search-criteria> element is specified

<operator>

Specifies an operator

  • If you specify this element under the <alert-search-criteria> element, it specifies the operator between multiple <criteria-expression> elements.

    Valid values: and, or
  • If you specify this element under the <criteria-expression> element, it specifies the operator for <key> and <value> elements.

    Valid values: equals, not equals, like, greater than, less than, in (to be used when the ID is used as a key)

Conditional; required if the <event-search-criteria> element is specified

The following figure illustrates a sample adapter request for the get-event operation: 

Sample adapter request for the get-event operation

<scom-request>
  <operation-name>get-event</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <event-search-criteria>
        <criteria-expression>
          <key>Id</key>
          <value>d6da42ec-da39-491e-afcb-9c2ee192923d</value>
          <operator>equals</operator>
        </criteria-expression>
      </event-search-criteria>
      <isrecurse>true</isrecurse>
    </command-parameters>
  </command-request>
</scom-request>



The following figure illustrates the adapter response for the sample request:

Sample adapter response for the get-event operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;get-event -criteria {Id = 'd6da42ec-da39-491e-afcb-
        9c2ee192923d'} -recurse</command>
        <execution-milliseconds>4156</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>1</count>
      </metadata>
      <output>
        <item>
          <Id>d6da42ec-da39-491e-afcb-9c2ee192923d</Id>
          <OriginalId>09784b06-1b99-4c54-b4e5-d809f1f2a71f</OriginalId>
          <MonitoringObjectId>adb901fe-08f4-490e-722f-d65430015064</MonitoringObjectId>
          <MonitoringClassId>ab4c891f-3359-3fb6-0704-075fbfe36710</MonitoringClassId>
          <MonitoringObjectName />
          <MonitoringObjectDisplayName>win2stdvm.neuron.com</MonitoringObjectDisplayName>
          <MonitoringObjectPath>win2stdvm.neuron.com</MonitoringObjectPath>
          <MonitoringObjectFullName>win2stdvm.neuron.com</MonitoringObjectFullName>
          <MonitoringRuleId>fe17ed88-9f59-8b80-b1a5-          ee42b80b95c8</MonitoringRuleId>
          <MonitoringRuleDisplayName>Collect Distributed Workflow Test
           Event</MonitoringRuleDisplayName>
          <MonitoringRuleDescription>Collects events logged by the "Log
           Distributed Workflow Test Event" rule</MonitoringRuleDescription>
          <PublisherName>Health Service Script</PublisherName>
          <Number>6022</Number>
          <Description>LogEndToEndEvent.js : This event is logged to the Windows
           Event Log periodically to test a event collection.</Description>
          <CategoryId>0</CategoryId>
          <Category />
          <User>N/A</User>
          <Channel>Operations Manager</Channel>
          <LevelId>4</LevelId>
          <Level />
          <LoggingComputer>WIN2STDVM</LoggingComputer>
          <EventData />
          <Parameters>{LogEndToEndEvent.js, This event is logged to the Windows
           Event Log periodically to test a event collection.}</Parameters>
          <TimeGenerated>3/24/2009 8:45:00 AM</TimeGenerated>
          <TimeAdded>3/24/2009 8:45:30 AM</TimeAdded>
          <ManagementGroup>M1</ManagementGroup>
          <ManagementGroupId>ae1fcf8a-8088-31d8-93ec-90fe77a32d44</ManagementGroupId>
        </item>
      </output>
    </command-output>
  </commands-output>
</scom-response>
Was this page helpful? Yes No Submitting... Thank you

Comments