code: private void processCounters(Put p, JSONObject eventDetails, String key) {
  
      try {
        JSONObject jsonCounters = eventDetails.getJSONObject(key);
        String counterMetaGroupName = jsonCounters.getString(NAME);
        JSONArray groups = jsonCounters.getJSONArray(GROUPS);
        for (int i = 0; i < groups.length(); i++) {
          JSONObject aCounter = groups.getJSONObject(i);
          JSONArray counts = aCounter.getJSONArray(COUNTS);
          for (int j = 0; j < counts.length(); j++) {
            JSONObject countDetails = counts.getJSONObject(j);
            populatePut(p, Constants.INFO_FAM_BYTES, counterMetaGroupName, aCounter.get(NAME)
                .toString(), countDetails.get(NAME).toString(), countDetails.getLong(VALUE));
          }
        }
      } catch (JSONException e) {
        throw new ProcessingException(" Caught json exception while processing counters ", e);
      }
  
    }
docs: process the counter details example line in .jhist file for counters: { "name":"MAP_COUNTERS",
  "groups":[ { "name":"org.apache.hadoop.mapreduce.FileSystemCounter",
  "displayName":"File System Counters", "counts":[ { "name":"HDFS_BYTES_READ",
  "displayName":"HDFS: Number of bytes read", "value":480 }, { "name":"HDFS_BYTES_WRITTEN",
  "displayName":"HDFS: Number of bytes written", "value":0 } ] }, {
  "name":"org.apache.hadoop.mapreduce.TaskCounter", "displayName":"Map-Reduce Framework",
  "counts":[ { "name":"MAP_INPUT_RECORDS", "displayName":"Map input records", "value":10 }, {
  "name":"MAP_OUTPUT_RECORDS", "displayName":"Map output records", "value":10 } ] } ] }