LEVEL | 113 |DATE | 114 | 115 |OVERVIEW | 116 |
├── .github
├── dependabot.yml
└── workflows
│ └── go.yml
├── .gitignore
├── Dockerfile.test-race
├── LICENSE
├── README.md
├── bench_test.go
├── chunk.go
├── chunk_test.go
├── demo
├── .dockerignore
├── Dockerfile
├── README.md
├── driver-mattn.go.txt
├── driver-modernc.go.txt
├── go.mod.txt
├── main.go
└── public
│ ├── index.html
│ └── main.js
├── docs
├── diagram.png
├── logo.png
├── repository-open-graph.png
├── repository-open-graph.psd
└── ui.png
├── expr.go
├── expr_parse_state.go
├── expr_test.go
├── go.mod
├── go.sum
├── handler.go
├── handler_test.go
├── http.go
├── ingester.go
├── ingester_test.go
├── memory
├── README.md
├── memory.go
├── memory_expr.go
├── memory_expr_test.go
├── wildcard.go
└── wildcard_test.go
├── sqlite
├── README.md
├── api_entries.go
├── api_ticks.go
├── expr.go
├── expr_test.go
├── storage.go
├── storage_db.go
├── storage_routine_checkpoint.go
├── storage_routine_size.go
├── storage_scheduler.go
├── storage_test.go
├── storage_test_driver_test.go
└── utils.go
├── sqlog.go
├── sqlog_api.go
├── storage.go
└── web
├── index.html
├── main.js
├── reset.css
└── styles.css
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "gomod"
9 | directory: "/"
10 | schedule:
11 | interval: "weekly"
12 | target-branch: "main"
13 | reviewers:
14 | - "nidorx"
15 | commit-message:
16 | prefix: "mod:"
17 |
--------------------------------------------------------------------------------
/.github/workflows/go.yml:
--------------------------------------------------------------------------------
1 | name: Go
2 | on:
3 | push:
4 | branches:
5 | - main
6 | - dev
7 | - 'feature/**'
8 | paths:
9 | - '**.go'
10 | - 'go.mod'
11 | - '.golangci.yml'
12 | - '.github/workflows/go.yml'
13 | pull_request:
14 | paths:
15 | - '**.go'
16 | - 'go.mod'
17 | - '.golangci.yml'
18 | - '.github/workflows/go.yml'
19 | env:
20 | GOPROXY: "https://proxy.golang.org"
21 |
22 | permissions:
23 | contents: read
24 |
25 | jobs:
26 | test:
27 | name: Test
28 | strategy:
29 | matrix:
30 | go-version: [ 1.22.x ]
31 | platform: [ ubuntu-latest ] # macos-latest
32 | runs-on: ${{ matrix.platform }}
33 | steps:
34 | - name: Install Go
35 | uses: actions/setup-go@v3
36 | with:
37 | go-version: ${{ matrix.go-version }}
38 | - name: Checkout code
39 | uses: actions/checkout@v3
40 | - name: Run tests
41 | run: |
42 | go test -v -race ./...
43 |
44 | # Running tests with race detection consumes too much memory on Windows,
45 | # see https://github.com/golang/go/issues/46099 for details.
46 | test-windows:
47 | name: TestOnWindows
48 | strategy:
49 | matrix:
50 | go-version: [ 1.22.x ]
51 | platform: [ windows-latest ]
52 | runs-on: ${{ matrix.platform }}
53 | steps:
54 | - name: Install Go
55 | uses: actions/setup-go@v3
56 | with:
57 | go-version: ${{ matrix.go-version }}
58 | - name: Checkout code
59 | uses: actions/checkout@v3
60 | - name: Run tests
61 | run: |
62 | go test -v ./...
63 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 |
3 | *.exe
4 | *.db
5 | **/*.db
6 | demo/logs
--------------------------------------------------------------------------------
/Dockerfile.test-race:
--------------------------------------------------------------------------------
1 | # syntax=docker/dockerfile:1
2 |
3 | # used to test linux -race local
4 | # docker build --progress plain -t sqlot-test -f Dockerfile.test-race .
5 |
6 | FROM golang:1.23.2-alpine AS builder
7 |
8 | RUN go version
9 |
10 | RUN apk --no-cache add gcc g++
11 |
12 | WORKDIR /go/src/demo/
13 | COPY . ./
14 |
15 | RUN set -Eeux && go mod tidy && go mod download && go mod verify
16 |
17 | ARG GO_TAGS
18 | ARG PROJECT_VERSION
19 |
20 | RUN GOOS=linux CGO_ENABLED=1 go test -v -race ./...
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Alex Rodin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
5 | SQLog - Connecting the dots 6 |
7 |LEVEL | 113 |DATE | 114 | 115 |OVERVIEW | 116 |
154 | 155 | In addition to the UI, SQLog's search syntax is also 156 | inspired by Datadog. 157 | 158 |
159 | 160 |A query filter is composed of terms and operators.
163 |There are two types of terms:
164 |A single term is a single word such as test
or hello
.
170 | A sequence is a group of words surrounded by double quotes, such as "hello dolly"
.
171 |
176 | To combine multiple terms into a complex query, you can use any of the following case insensitive Boolean operators: 177 |
178 |Operator | 182 |Description | 183 |Example | 184 |
---|---|---|
AND |
189 | 190 | Intersection: both terms are in the selected events (if nothing is added, AND is taken by default) 191 | | 192 |authentication AND failure | 193 |
OR |
196 | Union: either term is contained in the selected events | 197 |authentication OR password | 198 |
204 | You can combine text with wildcards to enhance your searches. 205 |
206 |Wildcard | 210 |Description | 211 |
---|---|
? |
216 |
217 | Match a single special character or space. For example, to search
218 | for an attribute my_attribute with the value hello world , my_attribute:hello?world .
219 | |
220 |
* |
223 |
224 | Perform a multi-character wildcard search.
225 |
|
233 |
237 | Note: Wildcards work as wildcards inside and outside of double quotes. For example,
238 | "*test*"
and *test*
matches a log which has the string test
in its message.
239 | You cand escape the wildcard with with the \
character (example "\*test\*"
).
240 |
Search syntax | 248 |Description | 249 |
---|---|
hello |
254 | Searches only the log message for the term hello . |
255 |
hello* |
258 | Searches all log attributes for strings that starts with hello . For example, hello_world . |
259 |
*world |
262 | Searches all log attributes for strings that finishes with world . For example, hello_world . |
263 |
Search syntax | 273 |Description | 274 |
---|---|
"hello world" |
279 | Searches only the log message for the exact term hello world . |
280 |
Search syntax | 289 |Description | 290 |
---|---|
hello world |
295 |
296 | Is equivalent to hello AND world .
297 | It searches only the log message for the terms hello and world .
298 | |
299 |
"hello world" "i am here" |
302 |
303 | It searches all log attributes for the terms hello world and i am here .
304 | |
305 |
To search on a specific attribute, add :
to specify you are searching on an attribute.
314 | For instance, if your attribute name is url and you want to filter on the
315 | url value https://github.com/nidorx/sqlog
, enter: url:https://github.com/nidorx/sqlog
316 |
Search query | 322 |Description | 323 |
---|---|
http.url_details.path:"/api/v1/test" |
328 |
329 | Searches all logs matching /api/v1/test in the attribute http.url_details.path .
330 | |
331 |
http.url:/api-v1/* |
334 |
335 | Searches all logs containing a value in http.url attribute that start with /api-v1/
336 | |
337 |
http.status_code:[200 TO 299] http.url_details.path:/api-v1/* |
340 |
341 | Searches all logs containing a http.status_code value between 200 and 299, and
342 | containing a value in http.url_details.path attribute that start with
343 | /api-v1/
344 | |
345 |
351 | You can use numerical operators (<
,>
, <=
, or >=
) to
352 | perform a search.
353 | For instance, retrieve all logs that have a response time over 100ms with: http.response_time:>100
354 |
356 | You can search for numerical attribute within a specific range. For instance, retrieve all your 4xx errors with: http.status_code:[400 TO 499]
357 |