﻿---
title: stack kb security-entity-analytics-api get-risk-score-history cli command
description: Get risk score history for an entity Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/docs/reference/elastic-cli/cli/stack/kb/security-entity-analytics-api/get-risk-score-history
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-entity-analytics-api get-risk-score-history cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-entity-analytics-api get-risk-score-history \
  --entity-type <entity-type> \
  --entity-id <entity-id> \
  [options]
```

Get risk score history for an entity
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--entity-type enum required">
    The type of entity to retrieve history for.
    **Values:** host, user, service, generic
  </definition>
  <definition term="--entity-id string required">
    The identifier of the entity to retrieve history for.
  </definition>
  <definition term="--from string">
    Start of the time range, in date-math syntax. Defaults to 90 days ago.
  </definition>
  <definition term="--to string">
    End of the time range, in date-math syntax. Defaults to now.
  </definition>
  <definition term="--score-type enum">
    Filter entries by the type of score recorded (`base`, `propagated`, or `resolution`).
    **Values:** base, propagated, resolution
  </definition>
  <definition term="--include-contributions">
    When true, each entry also includes the contributions recorded for that scoring run (`inputs`, `modifiers`, category 2 fields, and `criticality_level`), when present on the underlying document.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
  <definition term="--no-validate">
    skip input validation and send the request as-is
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--output-fields string">
    comma-separated list of fields to include in output (dot-notation supported)
  </definition>
  <definition term="--output-template string">
    Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
  </definition>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>