Commit 37f7f2d14e7abd3ac6035f0a494279ebc58becde

Authored by Thanasis Naskos
1 parent e0d6f0a8e8

Bug fix

Showing 1 changed file with 3 additions and 4 deletions

api/app/Http/Controllers/V1/Partners/XlsiemController.php View file @ 37f7f2d
... ... @@ -13,7 +13,7 @@
13 13 public function store(XlsiemRequest $request)
14 14 {
15 15 $dbEvents = [];
16   - $mqttEvents = [];
  16 + $eventAlarms = [];
17 17 foreach ($request->get('event_alarm') as $ev) {
18 18 $dbEvents[] = [
19 19 'asset_id' => $request->get('asset_id'),
20 20  
21 21  
... ... @@ -39,13 +39,12 @@
39 39 'priority' => isset($ev['priority']) ? $ev['priority'] : null,
40 40 'confidence' => isset($ev['confidence']) ? $ev['confidence'] : null
41 41 ];
42   - Mqtt::ConnectAndPublish('xlsiem/event', json_encode($mqttEvents), 1);
43 42 }
44   - $mqttEvents = {
  43 + $mqttEvents = array(
45 44 'asset_id' => $request->get('asset_id'),
46 45 'timestamp' => Carbon::createFromTimestamp($request->get('timestamp')),
47 46 'event_alarm' => $eventAlarms
48   - };
  47 + );
49 48  
50 49  
51 50 // publish to MQTT Broker