Export specific fields from Alert definitions via JBoss ON CLI script

Solution Verified - Updated -

Issue

  • Export only certain fields from Alert Definitions
  • Export Alert Definitions in true csv format, text quoted and comma separated

Environment

  • Red Hat JBoss Operations Network (ON) 3.1.2, 3.2, 3.3
  • ON Command Line Interface (CLI) 3.1.2, 3.2, 3.3
  • CLI script:
var criteria = new AlertDefinitionCriteria();//search for the alert definitions
var alertdefs = AlertDefinitionManager.findAlertDefinitionsByCriteria(criteria) 
exporter.setTarget('raw', 'output.txt') ;
if ( alertdefs != null ) { 
  if ( alertdefs.size() > 0 ) { 
      for ( i =0; i < alertdefs.size(); ++i) { 
        alert = alertdefs.get(i);   
        exporter.write(alert) ;      
     } 

   } 
  }

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content