container/src/main/java/com/streamsets/datacollector/runner/Pipeline.java
private Record createStopEvent(PipelineStopReason stopReason) {
    Preconditions.checkState(stopEventStage != null, "Stop Event Stage is not set!");
    EventRecord eventRecord = new EventRecordImpl(
      "pipeline-stop",
      1,
      stopEventStage.getInfo().getInstanceName(),
      "",
      null,
      null
    );

    Map<String, Field> rootField = new LinkedHashMap<>();
    rootField.put("reason", Field.create(Field.Type.STRING, stopReason.name()));
    rootField.put("pipelineId", Field.create(Field.Type.STRING, name));
    rootField.put("pipelineTitle", Field.create(Field.Type.STRING, pipelineConf.getTitle()));

    eventRecord.set(Field.create(rootField));
    return eventRecord;
  }
private Record createStopEvent(PipelineStopReason stopReason) {
    Preconditions.checkState(stopEventStage != null, "Stop Event Stage is not set!");
    EventRecord eventRecord = new EventRecordImpl(
      "pipeline-stop",
      1,
      stopEventStage.getInfo().getInstanceName(),
      "",
      null,
      null
    );

    Map<String, Field> rootField = new LinkedHashMap<>();
    rootField.put("reason", Field.create(Field.Type.STRING, stopReason.name()));
    rootField.put("pipelineId", Field.create(Field.Type.STRING, name));
    rootField.put("pipelineTitle", Field.create(Field.Type.STRING, pipelineConf.getTitle()));

    eventRecord.set(Field.create(rootField));
    return eventRecord;
  }
Create pipeline stop event.