イベント・セレクターは、イベントの集合を定義します。
イベント・セレクターは、プロパティー・データ (属性またはサブエレメント) に基づいて一連のイベントを定義する正規表現です。例えば、イベント・セレクターは、重大度が 30 より大きい (警告) 特定のホストのすべてのイベントを指定します。イベント・セレクターを使用して、イベント・グループの定義、フィルター基準の指定、およびイベント・サーバーの照会を行います。
Common Base Event 仕様は XML に基づいているため、イベント・セレクターは、XPath 構文のサブセットを使用して作成されます。 イベント・セレクターに使用できる特定の構文は、 次の表に要約を示すように、そのイベント・セレクターの使用方法によって異なります。
イベント・セレクターの目的 | 構文 |
---|---|
イベント・グループの定義 | デフォルトのデータ・ストア・プラグインによってサポートされる XPath サブセットに限定されます。 |
イベント・アクセス・インターフェースを介したイベントの照会およびパージ | デフォルトのデータ・ストア・プラグインによってサポートされる XPath サブセットに限定されます。 |
エミッター・フィルター構成 | 任意の有効な XPath |
通知ヘルパー・インターフェースを介したサブスクリプション | 任意の有効な XPath |
XPath は、XML 文書のパーツを識別するために使用する標準言語です。 詳しくは、http://www.w3.org/TR/xpath の XPath 仕様を参照してください。
CommonBaseEvent[@attribute = value]value は、数値または単一引用符または二重引用符で囲まれたストリングのいずれかです。
CommonBaseEvent[/subelement/@attribute = value]
XPath 演算子を使用する場合は、以下の一般規則に従ってください。
以下は、有効な XPath イベント・セレクターの例です。
XPath イベント・セレクター | セレクターの定義 |
---|---|
CommonBaseEvent[@extensionName = 'ApplicationStarted'] | extensionName 属性が ApplicationStarted であるすべてのイベント |
CommonBaseEvent[sourceComponentId/ @location = "server1"] | location 属性が server1 である sourceComponentId エレメントを含むすべてのイベント |
CommonBaseEvent[@severity] | 値にかかわらず severity 属性を持つすべてのイベント |
CommonBaseEvent[@creationTime < '2003-12-10T12:00:00-05:00' and @severity > 30] | 2003 年 12 月 10 日米東部標準時正午より前に作成され、 重大度が 30 (警告) より大きいすべてのイベント |
CommonBaseEvent[contains(@msg, 'disk full')] | msg 属性内に出現する、句 disk full を持つすべてのイベント |
CommonBaseEvent[(@severity = 30 or @severity = 50) and @priority = 100] | severity 属性が 30 または 50 に等しく、priority 属性が 100 に等しいすべてのイベント |
CommonBaseEvent[30 < @priority and contains('this message', @msg)]代わりに、この例は以下のように書き直すことができます。
CommonBaseEvent[@priority > 30 and contains(@msg, 'this message')]
CommonBaseEvent[predicate_expression]CommonBaseEvent エレメントと関連付けられるのは、単一の述部式のみです。 スタック述部はサポートされていません (例えば、CommonBaseEvent[@extensionName = "server_down"][@severity = 10])。
CommonBaseEvent[contextDataElement[@contextValue = "myContextValue"] /@contextId = "myContextId"]代わりに、この例は以下のように書き直すことができます。
CommonBaseEvent[contextDataElement[@contextValue = "myContextValue" and @contextId = "myContextId"]]
CommonBaseEvent[extendedDataElements[@type = 'int' and children/@type = 'intArray' and children/@name = 'myName' and @value = 10]]代わりに、この例は、トップレベルと第 2 レベルの属性をまとめてグループ化し、以下のように書き直すことができます。
CommonBaseEvent[extendedDataElements[@type = 'int' and @value = 10 and children/@type = 'intArray' and children/@type = 'myName']]
CommonBaseEvent[extendedDataElements[values = "myVal" and @type = "string"]]
CommonBaseEvent[extendedDataElements[(values = "myVal" or values = "yourVal") and @type = "string"]]この例では、type 式は括弧で囲んだ複合式の両方の辺に適用されます。括弧内で異なる type 式を指定することによってこの式をオーバーライドすることはできません。
CommonBaseEvent[extendedDataElements[values = "myVal" and starts-with(@type, 'string')]]
(c) Copyright IBM Corporation 2005, 2006.
本製品では Eclipse テクノロジーが採用されています。(http://www.eclipse.org)