API response filtering

Must-share information (formatted with Markdown):

  • SonarQube 9.9LTS
  • Dockerized
  • what are you trying to achieve: pulling metrics from API, sending result JSON from Jenkins job to Splunk
  • what have you tried so far to achieve this: curl to API
    What can be done to filter metrics, where some have multiple periods reporting, only one of each? For example,
      {
        "metric": "security_rating",
        "value": "4.0",
        "bestValue": false
      },
      {
        "metric": "lines_to_cover",
        "value": "1812"
      },
      {
        "metric": "new_lines_to_cover",
        "periods": [
          {
            "index": 1,
            "value": "419"
          }
        ],
        "period": {
          "index": 1,
          "value": "419"
        }
      },

Two of these have no period involved, while the last one does.

Hi,

The period stuff is vestigial. You can ignore it.

 
HTH,
Ann