code: public static Optional<EngineEvent> parse(Event event) {
          Matcher matcher = PATTERN.matcher(event.getTag());
          JsonElement data = event.getData(JsonElement.class);
  
          if (matcher.matches() && data.isJsonObject()) {
              Optional<String> minionId = Optional.empty();
              JsonObject obj = data.getAsJsonObject();
              String timestamp = obj.get("_stamp").getAsString();
  
              if (obj.has("data") && obj.has("id")) {
                  minionId = Optional.of(obj.get("id").getAsString());
                  data = obj.get("data");
              } else {
                  obj.remove("_stamp");
              }
  
              EngineEvent result = new EngineEvent(matcher.group(1), matcher.group(2), timestamp, minionId, data);
              return Optional.of(result);
          } else {
              return Optional.empty();
          }
      }
docs: Utility method to parse e generic event to a more specific one
  @param event the generic event to parse
  @return an option containing the parsed value or non if it could not be parsed