Triggering multiple events through rest API Explorer with single payload.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 01:29 PM
Hi community,
I am trying to create multiple events with the same payload at a time rather than creating events at a different time stamps.
The below payload I am using to trigger single payload, Can some one help me or suggest me on the pay load to create multiple events with the single payload.
Thanks In Advance.
{
"source": "Zabbix",
"description": "Getting Around in Windows",
"message_key": "523214214",
"type": "Unavailable by ICMP ping",
"node": "TB-030711-SW1-P053",
"severity":"3"
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 03:30 PM
Hi, I suspect the solution will depend on your target platforms functionality\ability to parse the payload, but the simple solution would be to pass an array of objects. Something like (string is messy as formatted for background script window).
var myString = '{"data": [{"source": "sourceOne","description": "Getting Around in Windows 1","message_key": "abcdef001","type": "Unavailable by ICMP ping","node": "TB-030711-SW1-P053","severity":"3"},{"source": "sourceTwo","description": "Getting Around in Windows 2","message_key": "abcdef002","type": "Unavailable by ICMP ping","node": "TB-030711-SW1-P052","severity":"3"},{"source": "sourceThree","description": "Getting Around in Windows 3","message_key": "abcdef002","type": "Unavailable by ICMP ping","node": "TB-030711-SW1-P051","severity":"3"}]}';
var parser = new JSON();
var obj = parser.decode(myString);
gs.info('payload2 node ' + obj.data[1].node);