def event
      event = fields.to_h
      event[FIELD_TAGS] = tags.to_a
      event[FIELD_MESSAGE] = messages
      event[FIELD_TIMESTAMP] = timestamp

      event
    end
def event
      event = fields.to_h
      event[FIELD_TAGS] = tags.to_a
      event[FIELD_MESSAGE] = messages
      event[FIELD_TIMESTAMP] = timestamp

      event
    end
Create an event hash from `self`.

 * It contains the all of the current buffer's logged fields
 * We add the buffer's tags and add them as an array of strings to the
   `event['tags']` field.
 * We add the buffer's list of messages to `event['message']`. This field
   thus contains an array of {Message} objects.
 * We add the buffer's timestamp to the `event['@timestamp]` as a `Time`
   object in UTC.

 The typical event emitted here looks like this:

     {
       "beep" => "boop",
       "foo" => ["bar", "baz"],
       "tags" => ["request", "controller#action"],
       "message" => [
         #<Rackstash::Message:0x007f908b4414c0 ...>,
         #<Rackstash::Message:0x007f908d14aee0 ...>
       ],
       "@timestamp" => 2016-10-17 13:37:42 UTC
     }

 Note that the resulting hash still contains an Array of {Message}s in the
 `"message"` field and a `Time` object in the '@timestamp' field. This
 allows the {Flow}'s components (usually a {Filter} or the {Flow#encoder})
 to reject or adapt some messages based on their original attributes, e.g.,
 their severity or timestamp. It is the responsibility of the
 {Flow#encoder} to correctly format the `"@timestamp"` field.

 All other fields in the event Hash besides `"message"` and `@timestamp"`
 are either `Hash`, `Array`, frozen `String`, `Integer` or `Float` objects.
 All hashes (including nested hashes) use `String` keys.

 @return [Hash] the event expected by the event {Filter}s.