Learn how to query your logs from the Bonfire command line tool.
Bonfire is an open-source command line interface to query Graylog searches via the REST API. It emulates the experience of using tail on a local file and adds other valuable options.
For all of these examples, you will have to replace <your_cluster>.logs.ovh.com
with your assigned endpoint address. This information is on the email you received when you created your Logs Data Platform account or on the Logs Data Platform home page in the OVHcloud Control Panel. Similarly, you will have to replace [code]<logs-username>[/code] with the user you used to connect to Graylog.
Requirements
- Python
- Pip
- Quick Start for Logs Data Platform
Instructions
Install
tail -f
Password management
Typing your password can be avoided by using the -k
switch that will store your password using the python keyring, this will store your password in your Desktop keyring system.
Config file
To avoid repeating argument on the command line, you can create a config file (./bonfire.cfg or ~/.bonfire.cfg) to store where you want to connect:
You can define other named nodes and call them with the --node switch.
You can now call named node sadev:
Note that the listing will contain only your logs.
Stored queries
You can define named queries and call them from the command line.
You can index some logs first by using the following curl command. Don't forget to replace <YOUR-WRITE-TOKEN>
with the X-OVH-TOKEN of your stream and <YOUR-CLUSTER>
with the address of your cluster.
Use this command multiple times to generate multiple logs.
Add the following to your previous configuration file .bonfire.cfg:
Here is how you call bonfire with the ldp query.
Parametric queries
You can also define queries with parameters and define parameters from the command line.
You can index some logs first by using the following curl command. Don't forget to replace <YOUR-WRITE-TOKEN>
with the X-OVH-TOKEN of your stream and <YOUR-CLUSTER>
with the address of your cluster.
Use this command multiple times to generate multiple logs.
If you want to use a parametric query user_id for a field named user_id, you can use the following form for your query in your .bonfire.cfg:
Call
Go further
For more information and tutorials, please see our other Logs Data Platform support guides or explore the guides for other OVHcloud products and services.