---
title: JSON parsing
source: https://docs.newrelic.com/docs/workflow-automation/workflow-examples/basic-patterns/json-parsing
---

Fetch JSON from New Relic status API, parse component statuses, and log issues.

**Requirements:**

-   Status API access.
-   Log ingest permissions.

**What this workflow does:**

-   Fetches JSON data from the New Relic status API
-   Extracts and categorizes components by their operational status
-   Conditionally logs operational components (if enabled)
-   Conditionally logs non-operational components (if enabled)
-   Handles HTTP errors and logs error messages

**Key actions**: `http.get`, `newrelic.ingest.sendLogs`

```yaml
  name: parse_status_api

  steps:
    - name: fetchStatus
      type: action
      action: http.get
      version: 1
      inputs:
        url: 'https://status.newrelic.com/api/v2/summary.json'
        selectors:
          - name: operational
            expression: '.components[] | select(.status == "operational") | .name'
          - name: degraded
            expression: '.components[] | select(.status != "operational") | .name'

    - name: logNonOperational
      type: action
      action: newrelic.ingest.sendLogs
      version: 1
      inputs:
        logs:
          - message: 'Services with issues: ${{ .steps.fetchStatus.outputs.degraded | tostring }}'
            attributes:
              operationalServices: ${{ .steps.fetchStatus.outputs.operational }}
```

## Related topics [#related-topics]

[HTTP GET/POST](https://docs.newrelic.com/docs/workflow-automation/workflow-examples/basic-patterns/http-get-post)

Fetch JSON data from APIs

[Data passing](https://docs.newrelic.com/docs/workflow-automation/workflow-examples/basic-patterns/data-passing)

Pass parsed data between steps

[Utils transform actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/utils/utils-transform)

Transform data formats
