API - Get Index Request Log

Logs & Analytics

Searches the log of every request your Opensolr Index received, with the Solr parameters you already know. Each request is one document.

Endpointhttps://opensolr.com/solr_manager/api/request_log
MethodGET (all parameters in the query string)
Authemail and api_key of your account, as GET or POST parameters: Authentication.
In the panelQuery analytics

01 · Parameters

core_nameRequired

The name of your index. A cluster master includes its replicas.

qOptional

A Solr query on the log. Default *:*, every request.

fq[]Optional

Filters, as many as you need, for example fq[]=date:[NOW-1DAY TO NOW].

sortOptional

For example date desc.

startOptional

Offset, for paging.

rowsOptional

Requests per page. Default 100, at most 1000.

flOptional

The fields to return.

facet, facet.field[]Optional

facet=true and one or more fields to count, such as ip, path, q, http_status.

02 · Fields of a request

date

When it came in.

q

The search text, when there was one.

path

The request handler, such as /select or /update.

ip

The address it came from.

http_status

The HTTP status of the answer.

qtime, hits, size

Milliseconds Solr took, results found, size of the answer.

core_name

The index, useful on a cluster.

03 · Examples

Use curl -g so the square brackets go through as they are.

# Requests that did not answer 200, last 7 days, newest first
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&sort=date%20desc&fq[]=date:[NOW-7DAY%20TO%20NOW]&fq[]=-http_status:200"

# The 10 most searched texts and the busiest addresses of the last day, no documents
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&rows=0&fq[]=date:[NOW-1DAY%20TO%20NOW]&facet=true&facet.field[]=q&facet.field[]=ip&facet.limit=10"

# Searches slower than one second
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&sort=qtime%20desc&fq[]=qtime:[1000%20TO%20*]"

04 · Answer

The answer of Solr, always JSON: response.numFound, response.docs and, with facets, facet_counts.facet_fields. Page through more than 1000 requests with start.

05 · Errors

ERROR_INVALID_CORE_NAMEHTTP 200

No index name.

ERROR_NOT_CORE_OWNERHTTP 200

The index is not yours.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds: Rate limits.

06 · Related

The latest lines of the logs, without a query: tail_access_log, tail_apache_log.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.