Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fsources%2Ftime%2Flast.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Fcommands-reference%2Fsources%2Ftime%2Flast.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `last`

## Description

The `last` keyword specifies how far back in time a query should go, defined by a given `interval`.

Note

The value of the given `interval` MUST be non-negative.

## Syntax

```
source (logs|spans) last <interval>
```

## Example

The `last` keyword is simple to employ for both `logs` and `spans`.

```
source logs last 1h

source spans last 1d
```

Given the timerange in the Coralogix interface is `Last 1 Hour`, and we run the following query:

```
source spans last 1d
```

Then the result of this query will be the `spans` from the last 1 day. **There is no relationship between the \`interval\` in the \`last\` keyword and the timerange in the Coralogix UI.**

### Try it yourself

Open up your Coralogix explore screen and paste in the following query:

```
source logs last 1d
```
