The json message is created by nvmsgconv Gst-nvmsgconv — DeepStream 6.1.1 Release documentation
For your customized message, please refer to the gst-nvmsgconv plugin source code /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvmsgconv and the nvmsgconv library source code /opt/nvidia/deepstream/deepstream/sources/libs/nvmsgconv to understand how to generate json message within gst-nvmsgconv, and then you can customize you own.