This is a utility for generating some random event data. This was built for dumping data into Splunk, but could be used for any application.
- Existing communication plan - Use a packaged integration from the integrations page, or build your own
- xMatters account - If you don't have one, get one!
- Generator.js - The shared library for generating dummy events
Details of the installation go here.
- Log in to your xMatters instance as a user with the Developer role (or anyone with access to the target communication plan). On the Developer tab, click Edit > Integration Builder for the target communication plan.
- Expand the Shared libraries section (if necessary) and click the + Add button
- Update the name at the top from My Shared Library to
DataGenerator
, then paste in the contents of the Generator.js file and hit Save.
In a Integration Builder script, add all or some of the following code, depending on if you need corresponding active and terminated event pairs
var Generator = require( 'Generator' );
// Get the base event template
var activeEvent = Generator.getActiveEventBase();
var termEvent = Generator.getTerminatedEventBase();
// Generate a "fake" GUID.
var eventID = Generator.generateBadGUID();
// Get some random event and recipient data
var eventData = Generator.getSampleEventData();
var recipData = Generator.getSampleRecipient();
var resolvedRecipData = Generator.getResolvedRecipients();
// Overwrite elements in Base Event
activeEvent = Generator.mergeRecursive( activeEvent, eventData );
activeEvent.recipients = recipData;
activeEvent.id = eventID;
// Ditto for terminated event
termEvent = Generator.mergeRecursive( termEvent, eventData );
termEvent.recipients.data = activeEvent.recipients.data.concat( resolvedRecipData );
termEvent.recipients.count = termEvent.recipients.data.length;
termEvent.recipients.total = termEvent.recipients.data.length;
termEvent.id = eventID;
Testing will depend on what you are doing with the data and how the script is triggered.