Sha256: f10e1ead1c6930f3f3b27ad8500d0684985683dc3eb4b581a62920f8b9bdffa9

Contents?: true

Size: 581 Bytes

Versions: 31

Compression:

Stored size: 581 Bytes

Contents

module PatronusFati::MessageProcessor::Alert
  include PatronusFati::MessageProcessor

  def self.process(obj)
    src_mac = PatronusFati::DataModels::Mac.first_or_create(mac: obj[:source])
    dst_mac = PatronusFati::DataModels::Mac.first_or_create(mac: obj[:dest])
    other_mac = PatronusFati::DataModels::Mac.first_or_create(mac: obj[:other])

    PatronusFati::DataModels::Alert.first_or_create({created_at: obj.sec, \
      message: obj[:text]}, {created_at: obj.sec, message: obj[:text], \
      src_mac: src_mac, dst_mac: dst_mac, other_mac: other_mac})

    nil
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
patronus_fati-0.9.11 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.10 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.9 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.8 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.7 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.6 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.5 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.4 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.3 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.2 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.1 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.9.0 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.18 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.17 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.16 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.15 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.14 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.13 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.12 lib/patronus_fati/message_processor/alert.rb
patronus_fati-0.8.11 lib/patronus_fati/message_processor/alert.rb