How to export all Spectrum events via CLI
search cancel

How to export all Spectrum events via CLI

book

Article ID: 11647

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

In some cases, there may be a desire to export Spectrum Event data via CLI command line.

How can I export Event data via CLI?

Environment

DX NetOps Spectrum all releases

Resolution

There are generally two ways to export event data from the DDM database.

First method is to use Spectrum CLI and send the event report to an out file. However, there is a limitation of maximum 10,000 events.

  1. Using a BASH shell, navigate to $SPECROOT/vnmsh
  2. Run: ./connect
  3. Run: ./show events -a mh=<model_handle> or lh=<landscape handle> > event_rpt

The second method is to query the MySQL database and send the table data to an out file. There is no limitation on the query, but keep in mind that if viewing the data in Excel or another spreadsheet program, there may be a limit on the number of rows it can display. Some Event tables are too large to be imported into spreadsheet programs for view.

  1. Using a BASH shell, navigate to $SPECROOT/mysql/bin

  2. Run: echo "SELECT * FROM <table name>;" | mysql -uroot -proot <databasename> > <output file>.tsv

For example:

>echo "SELECT * FROM event;" | mysql -uroot -proot ddmdb > events_out.tsv 

The outfile can be *.tsv, *.csv, or *.txt

Additional Information

TechDocs : DX NetOps Spectrum 22.2 : Working with the Command Line Interface (CLI)