Class CsvWriter

All Implemented Interfaces:
OutputWriter

public class CsvWriter
extends AbstractOutputWriter
implements OutputWriter
This output writer can ONLY be used on a per query basis, not in a global output writer configuration because this aggregates all of the different attributes returned by the query into a single line in a csv file, using the QueryResult.getName() as the value of the header. The query can contain multiple MBeans by pattern matched ObjectName Example query configuration:

  "queries": [
  {
     "outputWriters": [
       {
          "@class": "org.jmxtrans.embedded.output.CsvWriter",
          "settings": {
             "outputFile": "log/jmxlog.csv"
           }
       }
      ],
      "objectName": "java.lang:type=Memory",
      "resultAlias": "jvm.memory",
      "attributes": [
         {
            "name": "HeapMemoryUsage",
            "keys": ["committed", "used"]
         },
         {
            "name": "NonHeapMemoryUsage",
            "keys": ["committed", "used"]
         }
      ]
  }
]
 
See embedded-jmxtrans configuration for more details.
Author:
Ryan Larson