---
title: logql package
description: The logql package provides functions for using LogQL to query a Loki data source.
url: https://docs.influxdata.com/flux/v0/stdlib/contrib/qxip/logql/
estimated_tokens: 509
product: Flux
version: v0
---

# logql package

-   Flux 0.192.0+
-   View InfluxDB support

The `logql` package is a user-contributed package maintained by the [package author](#package-author-and-maintainer).

The `logql` package provides functions for using [LogQL](https://grafana.com/docs/loki/latest/logql/) to query a [Loki](https://grafana.com/oss/loki/) data source. Import the `contrib/qxip/logql` package:

```js
import "contrib/qxip/logql"
```

The primary function in this package is `logql.query_range()`

## Options

```js
option logql.defaultAPI = "/loki/api/v1/query_range"

option logql.defaultURL = "http://127.0.0.1:3100"
```

### defaultAPI

`defaultAPI` is the default LogQL Query Range API Path.

### defaultURL

`defaultURL` is the default LogQL HTTP API URL.

## Functions

-   [logql.query\_range()](/flux/v0/stdlib/contrib/qxip/logql/query_range/)
