Export specific fields from Alert definitions via JBoss ON CLI script
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 of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
