Previous Topic: getIncidentViewer

Next Topic: API Registration

runQuery

Use runQuery to run a query and return the results in XML, rather than in the graphical query viewer. You can use this method to acquire CA Enterprise Log Manager data for an application that cannot embed the query or report viewer directly, such as those that cannot support Flash.

Add query specifications to the URL to filter the base query, as you do for getQueryViewer.

After using runQuery, format the XML data for display in an appropriate way for your environment. For example, you could embed a runQuery call in a web portal, and apply a style sheet to display the data.

runQuery Example

https://ELMSERVER:5250/spin/calmapi/runQuery.csp?objectId=Subscription/panels/Collection_Monitor_by_Log_Manager_By_Log_Name

Returns the following XML:

<?xml version="1.0" encoding="UTF-8" ?>
<Result>
	<Value>true</Value>
	<Description>Query run successful</Description>
	<QueryResults>
		<Version>1</Version>
		<Row number="1">
			<event_logname>CALM</event_logname>
			<event_count>581</event_count>
		</Row>
		<Row number="2">
			<event_logname>EiamSdk</event_logname>
			<event_count>131</event_count>
		</Row>
		<Result totalrows="2" returnedrows="2" startrow="1" endrow="2" executems="2382" mstofirst="2382" mstolast="2382" />
		<DbResult numberdbsqueried="1" numberdbsresponding="1" numberdbsnotresponding="0" listdbsresponding="../../LogManager/data/hot/machinename_1232571874.hot" listdbsnotresponding="" />
		<HostResult numbberhostsqueried="0" numberhostsresponding="0" numberhostsnotresponding="0" listhostsresponding="" listhostsnotresponding="" />
	</QueryResults>
	SQL ServerSELECT event_logname , SUM(event_count) AS FUNC_SUM_event_count FROM view_event WHERE ( ( datetime(event_time_gmt, 'unixepoch') >= datetime('now', '-6 hours') and datetime(event_time_gmt, 'unixepoch') < datetime('now') ) AND ( event_category = ? ) ) GROUP BY event_logname ORDER BY FUNC_SUM_event_count DESC LIMIT 10 ; [Operational Security]</Sql>
</Result>

More information:

getQueryViewer

getReportViewer