steampipe plugin install algolia

Table: algolia_log - Query Algolia Logs using SQL

Algolia is a powerful search-as-a-service solution, making it easy to build and optimize search experiences. It offers robust APIs and extensive documentation to customize the platform to specific needs. Algolia logs provide crucial insights into the operations and events occurring within the platform.

Table Usage Guide

The algolia_log table provides insights into the logs within Algolia. As a developer or system administrator, explore log-specific details through this table, including the type of events, timestamps, and associated metadata. Utilize it to uncover information about operations, such as search queries, indexing operations, and API calls, providing a clear overview of activities within the Algolia platform.

Examples

List all log entries

Explore your entire log history in chronological order, giving you the ability to track changes, spot trends and identify potential issues over time. This is particularly useful for auditing, debugging, and maintaining the overall health of your system.

select
*
from
algolia_log
order by
timestamp desc;
select
*
from
algolia_log
order by
timestamp desc;

List errors from the log

Identify instances where requests to Algolia have resulted in errors. This can be used to pinpoint specific issues and improve the overall performance of your application.

select
*
from
algolia_log
where
answer_code != 200
order by
timestamp desc;
select
*
from
algolia_log
where
answer_code != 200
order by
timestamp desc;

Find slow queries (>5ms) in the last 24 hours

Explore which queries have been performing slowly, taking more than 5 milliseconds, in the last 24 hours. This can be useful for identifying potential bottlenecks and improving overall system performance.

select
*
from
algolia_log
where
processing_time_ms > 5
and age(timestamp) < interval '24 hours'
order by
timestamp desc;
select
*
from
algolia_log
where
processing_time_ms > 5
and julianday('now') - julianday(timestamp) < 1
order by
timestamp desc;

Log entries by user agent

Explore the frequency of different user agents accessing your system to identify trends or anomalies. This can assist in understanding user behaviors, detecting potential security risks, and optimizing system performance.

select
query_headers ->> 'User-Agent' as user_agent,
count(*)
from
algolia_log
group by
user_agent
order by
count desc;
select
json_extract(query_headers, '$."User-Agent"') as user_agent,
count(*)
from
algolia_log
group by
user_agent
order by
count(*) desc;

Schema for algolia_log

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
answertextAnswer body, truncated after 1000 characters. JSON format, but returned as a string due to the truncation.
answer_codebigintCode of the answer.
exhaustivebooleanExhaustive flags used during the query.
indextextIndex the query was executed against, or null for metadata queries.
inner_queriesjsonbContains an object for each performed query with the indexName, queryID, offset, and userToken.
ipinetIP address of the request client.
methodtextHTTP method used for the query, e.g. GET, POST.
number_api_callsbigintNumber of API calls.
processing_time_msbigintProcessing time for the request in milliseconds.
query_bodytextRequest body, truncated after 1000 characters.
query_headersjsonbHTTP headers for the query.
query_number_hitsbigintNumber of hits returned for the query.
sha1textSHA1 ID of the log entry.
timestamptimestamp with time zoneTime when the log entry was created.
urltextURL of the query request.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- algolia

You can pass the configuration to the command with the --config argument:

steampipe_export_algolia --config '<your_config>' algolia_log