|
1 | | -# tailpipe-mod-nginx-access-log-detections |
| 1 | +# Nginx Access Log Detections Mod for Powerpipe |
| 2 | + |
| 3 | +View dashboards, run detections and scan for anomalies across your Nginx access logs. |
| 4 | + |
| 5 | +<!-- |
| 6 | +TODO: Insert images |
| 7 | +--> |
| 8 | + |
| 9 | +## Documentation |
| 10 | + |
| 11 | +- **[Dashboards →](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-nginx-access-log-detections/dashboards)** |
| 12 | +- **[Benchmarks and detections →](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-nginx-access-log-detections/benchmarks)** |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +### Installation |
| 17 | + |
| 18 | +Install Powerpipe (https://powerpipe.io/downloads), or use Brew: |
| 19 | + |
| 20 | +```sh |
| 21 | +brew install turbot/tap/powerpipe |
| 22 | +``` |
| 23 | + |
| 24 | +Install the mod: |
| 25 | + |
| 26 | +```sh |
| 27 | +mkdir dashboards |
| 28 | +cd dashboards |
| 29 | +powerpipe mod install github.com/turbot/tailpipe-mod-nginx-access-log-detections |
| 30 | +``` |
| 31 | + |
| 32 | +This mod also requires [Tailpipe](https://tailpipe.io) with the [Nginx plugin](https://hub.tailpipe.io/plugins/turbot/nginx). |
| 33 | + |
| 34 | +Install Tailpipe (https://tailpipe.io/downloads), or use Brew: |
| 35 | + |
| 36 | +```sh |
| 37 | +brew install turbot/tap/tailpipe |
| 38 | +tailpipe plugin install nginx |
| 39 | +``` |
| 40 | + |
| 41 | +### Configuration |
| 42 | + |
| 43 | +Configure your log source: |
| 44 | + |
| 45 | +```sh |
| 46 | +vi ~/.tailpipe/config/nginx.tpc |
| 47 | +``` |
| 48 | + |
| 49 | +```hcl |
| 50 | +partition "nginx_access_log" "test" { |
| 51 | + source "file" { |
| 52 | + paths = ["/Users/mscott/nginx_access_logs"] |
| 53 | + file_layout = "%{DATA}.log" |
| 54 | + } |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +### Log Collection |
| 59 | + |
| 60 | +Collect logs: |
| 61 | + |
| 62 | +```sh |
| 63 | +tailpipe collect nginx_access_log |
| 64 | +``` |
| 65 | + |
| 66 | +When running `tailpipe collect` for the first time, logs from the last 7 days are collected. Subsequent `tailpipe collect` runs will collect logs from the last collection date. |
| 67 | + |
| 68 | +You can override the default behaviour by specifying `--from`: |
| 69 | + |
| 70 | +```sh |
| 71 | +tailpipe collect nginx_access_log --from 2025-01-01 |
| 72 | +``` |
| 73 | + |
| 74 | +You can also use relative times. For instance, to collect logs from the last 60 days: |
| 75 | + |
| 76 | +```sh |
| 77 | +tailpipe collect nginx_access_log --from T-60d |
| 78 | +``` |
| 79 | + |
| 80 | +Please note that if you specify a date in `--from`, Tailpipe will delete any collected data for that partition starting from that date to help avoid gaps in the data. |
| 81 | + |
| 82 | +For additional examples on using `tailpipe collect`, please see [tailpipe collect](https://tailpipe.io/docs/reference/cli/collect) reference documentation. |
| 83 | + |
| 84 | +### Browsing Dashboards |
| 85 | + |
| 86 | +Start the dashboard server: |
| 87 | + |
| 88 | +```sh |
| 89 | +powerpipe server |
| 90 | +``` |
| 91 | + |
| 92 | +Browse and view your dashboards at **http://localhost:9033**. |
| 93 | + |
| 94 | +### Running Benchmarks in Your Terminal |
| 95 | + |
| 96 | +Instead of running benchmarks in a dashboard, you can also run them within your |
| 97 | +terminal with the `powerpipe benchmark` command: |
| 98 | + |
| 99 | +List available benchmarks: |
| 100 | + |
| 101 | +```sh |
| 102 | +powerpipe benchmark list |
| 103 | +``` |
| 104 | + |
| 105 | +<!-- TODO: add a benchmark name and uncomment |
| 106 | +Run a benchmark: |
| 107 | +
|
| 108 | +```sh |
| 109 | +powerpipe benchmark run nginx_access_log_detections.benchmark. |
| 110 | +``` |
| 111 | +--> |
| 112 | +Different output formats are also available, for more information please see |
| 113 | +[Output Formats](https://powerpipe.io/docs/reference/cli/benchmark#output-formats). |
| 114 | + |
| 115 | +## Open Source & Contributing |
| 116 | + |
| 117 | +This repository is published under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0). Please see our [code of conduct](https://github.com/turbot/.github/blob/main/CODE_OF_CONDUCT.md). We look forward to collaborating with you! |
| 118 | + |
| 119 | +[Tailpipe](https://tailpipe.io) and [Powerpipe](https://powerpipe.io) are products produced from this open source software, exclusively by [Turbot HQ, Inc](https://turbot.com). They are 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](https://turbot.com/open-source). |
| 120 | + |
| 121 | +## Get Involved |
| 122 | + |
| 123 | +**[Join #tailpipe and #powerpipe on Slack →](https://turbot.com/community/join)** |
| 124 | + |
| 125 | +Want to help but don't know where to start? Pick up one of the `help wanted` issues: |
| 126 | + |
| 127 | +- [Powerpipe](https://github.com/turbot/powerpipe/labels/help%20wanted) |
| 128 | +- [Tailpipe](https://github.com/turbot/tailpipe/labels/help%20wanted) |
| 129 | +- [Nginx Access Log Detections Mod](https://github.com/turbot/tailpipe-mod-nginx0-access-log-detections/labels/help%20wanted) |
0 commit comments