Tailpipe is an open-source CLI tool that allows you to collect logs and query them with SQL.
Apache is a popular open-source web server.
The Apache Plugin for Tailpipe allows you to collect and query Apache access logs using SQL to track activity, monitor trends, detect anomalies, and more!
- Get started →
- Documentation: Table definitions & examples
- Community: Join #tailpipe on Slack →
- Get involved: Issues
Install Tailpipe from the downloads page:
# MacOS
brew install turbot/tap/tailpipe# Linux or Windows (WSL)
sudo /bin/sh -c "$(curl -fsSL https://tailpipe.io/install/tailpipe.sh)"Install the plugin:
tailpipe plugin install apacheConfigure your table partition and data source:
vi ~/.tailpipe/config/apache.tpcpartition "apache_access_log" "my_logs" {
source "file" {
paths = ["/var/log/apache/access/"]
file_layout = `%{DATA}.log`
}
}Note: By default, the apache_access_log table can collect logs using the common and combined log formats. If your logs use a custom log format, please see Collect logs with custom log format.
Download, enrich, and save logs from your source (examples):
tailpipe collect apache_access_logEnter interactive query mode:
tailpipe queryRun a query:
select
remote_addr,
status,
request_uri,
request_method,
count(*) as request_count
from
apache_access_log
group by
remote_addr,
status,
request_uri,
request_method
order by
request_count desc
limit 1;+-----------------+--------+-------------------+----------------+---------------+
| remote_addr | status | request_uri | request_method | request_count |
+-----------------+--------+-------------------+----------------+---------------+
| 186.187.161.169 | 502 | /path/to/web/page | POST | 12345 |
+-----------------+--------+-------------------+----------------+---------------+Prerequisites:
Clone:
git clone https://github.com/turbot/tailpipe-plugin-apache.git
cd tailpipe-plugin-apacheAfter making your local changes, build the plugin, which automatically installs the new version to your ~/.tailpipe/plugins directory:
makeRe-collect your data:
tailpipe collect apache_access_logTry it!
tailpipe query
> .inspect apache_access_logThis repository is published under the Apache 2.0 (source code) and CC BY-NC-ND (docs) licenses. Please see our code of conduct. We look forward to collaborating with you!
Tailpipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our Open Source FAQ.
Want to help but don't know where to start? Pick up one of the help wanted issues:
