gulp-cli 1.0.6__tar.gz → 1.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gulp_cli-1.0.6/src/gulp_cli.egg-info → gulp_cli-1.0.8}/PKG-INFO +4 -4
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/examples.md +7 -2
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/pyproject.toml +3 -3
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/_version.py +3 -3
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/db.py +60 -15
- {gulp_cli-1.0.6 → gulp_cli-1.0.8/src/gulp_cli.egg-info}/PKG-INFO +4 -4
- gulp_cli-1.0.8/src/gulp_cli.egg-info/requires.txt +4 -0
- gulp_cli-1.0.6/src/gulp_cli.egg-info/requires.txt +0 -4
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/.github/workflows/python-package.yml +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/.gitignore +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/README.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/command-reference.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/extensions.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/getting-started.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/resource-management.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/troubleshooting-cli.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/setup.cfg +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/__main__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/cli.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/client.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/acl.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/auth.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/collab.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/context.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/enhance_map.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/glyph.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/ingest.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/mapping.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/operations.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/plugin.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/query.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/source.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/stats.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/storage.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/user_group.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/users.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/config.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/query_sigma_zip.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/story.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension_helpers.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extensions.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/output.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/utils.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/SOURCES.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/dependency_links.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/entry_points.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/top_level.txt +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gulp-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Command-line client for gULP
|
|
5
5
|
Author-email: Mentat <info@mentat.is>
|
|
6
6
|
Requires-Python: >=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: typer
|
|
9
|
-
Requires-Dist: rich
|
|
10
|
-
Requires-Dist: click==8.
|
|
8
|
+
Requires-Dist: typer==0.23.1
|
|
9
|
+
Requires-Dist: rich==15.0.0
|
|
10
|
+
Requires-Dist: click==8.3.3
|
|
11
11
|
Requires-Dist: gulp-sdk
|
|
12
12
|
|
|
13
13
|
# 🚀 gulp-cli
|
|
@@ -171,6 +171,10 @@ wait # Wait for all background jobs
|
|
|
171
171
|
# Ingest CSV with specific delimiter and encoding
|
|
172
172
|
gulp-cli ingest file incident-001 csv /data/access_log.csv \
|
|
173
173
|
--plugin-params '{"delimiter":";","encoding":"iso-8859-1","has_header":true}'
|
|
174
|
+
|
|
175
|
+
# pass mapping directly without using a mapping file
|
|
176
|
+
gulp-cli ingest file test_operation csv ./samples/mftecmd/sample_record.csv --plugin-params '{ "mapping_parameters": { "mappings": { "test
|
|
177
|
+
_mapping": { "fields": { "Created0x10": { "ecs": [ "@timestamp" ] } } } } } }' --reset-operation --wait
|
|
174
178
|
```
|
|
175
179
|
|
|
176
180
|
### JSON Logs Ingestion
|
|
@@ -505,6 +509,7 @@ gulp-cli query external incident-001 \
|
|
|
505
509
|
--q '{"query":{"match_all":{}}}' \
|
|
506
510
|
--preview --limit 100 --offset 0
|
|
507
511
|
```
|
|
512
|
+
|
|
508
513
|
```
|
|
509
514
|
|
|
510
515
|
### Export Query Results
|
|
@@ -967,7 +972,7 @@ gulp-cli acl make-private link-456 --obj-type link
|
|
|
967
972
|
|
|
968
973
|
---
|
|
969
974
|
|
|
970
|
-
## Index Management Workflows
|
|
975
|
+
## Index Management Workflows
|
|
971
976
|
|
|
972
977
|
### Inspect Indexes
|
|
973
978
|
|
|
@@ -1093,7 +1098,7 @@ gulp-cli enhance-map delete <enhance_map_obj_id>
|
|
|
1093
1098
|
### Query Sigma Rules from ZIP (Extension)
|
|
1094
1099
|
|
|
1095
1100
|
> needs non-free `query_sigma_zip` plugin to be installed on the server, this is provided just as an example.
|
|
1096
|
-
|
|
1101
|
+
|
|
1097
1102
|
```bash
|
|
1098
1103
|
# Execute all Sigma rules inside a zip archive
|
|
1099
1104
|
gulp-cli query sigma-zip incident-001 \
|
|
@@ -15,9 +15,9 @@ description = "Command-line client for gULP"
|
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.12"
|
|
17
17
|
dependencies = [
|
|
18
|
-
"typer
|
|
19
|
-
"rich
|
|
20
|
-
"click==8.
|
|
18
|
+
"typer==0.23.1",
|
|
19
|
+
"rich==15.0.0",
|
|
20
|
+
"click==8.3.3",
|
|
21
21
|
"gulp-sdk",
|
|
22
22
|
]
|
|
23
23
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 0,
|
|
21
|
+
__version__ = version = '1.0.8'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 8)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gda10ffa52'
|
|
@@ -6,10 +6,23 @@ from typing import Any
|
|
|
6
6
|
import typer
|
|
7
7
|
from gulp_sdk.api.request_utils import wait_for_request_stats
|
|
8
8
|
from gulp_sdk.websocket import WSMessage, WSMessageType
|
|
9
|
-
from rich.progress import
|
|
9
|
+
from rich.progress import (
|
|
10
|
+
BarColumn,
|
|
11
|
+
Progress,
|
|
12
|
+
SpinnerColumn,
|
|
13
|
+
TaskProgressColumn,
|
|
14
|
+
TextColumn,
|
|
15
|
+
TimeElapsedColumn,
|
|
16
|
+
)
|
|
10
17
|
|
|
11
18
|
from gulp_cli.client import get_client
|
|
12
|
-
from gulp_cli.output import
|
|
19
|
+
from gulp_cli.output import (
|
|
20
|
+
console,
|
|
21
|
+
print_json,
|
|
22
|
+
print_records,
|
|
23
|
+
print_warning,
|
|
24
|
+
print_result,
|
|
25
|
+
)
|
|
13
26
|
from gulp_cli.utils import parse_json_option
|
|
14
27
|
|
|
15
28
|
app = typer.Typer(help="Database and OpenSearch commands")
|
|
@@ -38,7 +51,9 @@ async def _wait_for_stats_create(
|
|
|
38
51
|
ws.on_message(WSMessageType.STATS_UPDATE, _on_stats)
|
|
39
52
|
|
|
40
53
|
try:
|
|
41
|
-
await asyncio.wait_for(
|
|
54
|
+
await asyncio.wait_for(
|
|
55
|
+
asyncio.gather(*[ev.wait() for ev in events.values()]), timeout=timeout
|
|
56
|
+
)
|
|
42
57
|
return []
|
|
43
58
|
except asyncio.TimeoutError:
|
|
44
59
|
return [rid for rid, ev in events.items() if not ev.is_set()]
|
|
@@ -50,11 +65,25 @@ async def _wait_for_stats_create(
|
|
|
50
65
|
@app.command("rebase-by-query")
|
|
51
66
|
def rebase_by_query(
|
|
52
67
|
operation_id: str,
|
|
53
|
-
offset_msec: int = typer.Option(
|
|
68
|
+
offset_msec: int = typer.Option(
|
|
69
|
+
...,
|
|
70
|
+
"--offset-msec",
|
|
71
|
+
help="Milliseconds to add to timestamps (negative to subtract)",
|
|
72
|
+
),
|
|
54
73
|
flt: str | None = typer.Option(None, "--flt", help="GulpQueryFilter JSON object"),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
fields: list[str] | None = typer.Option(
|
|
75
|
+
None,
|
|
76
|
+
"--field",
|
|
77
|
+
help="Optional extra field to rebase other than `@timestamp` and `gulp.timestamp` (no `flat_object` fields, only `date` and integer/long fields are supported; integer/long values are treated as epoch timestamps and the script heuristically infers seconds, milliseconds, microseconds, or nanoseconds before applying the offset)",
|
|
78
|
+
),
|
|
79
|
+
wait: bool = typer.Option(
|
|
80
|
+
False,
|
|
81
|
+
"--wait",
|
|
82
|
+
help="Wait for rebase completion with websocket-driven progress",
|
|
83
|
+
),
|
|
84
|
+
wait_timeout: int = typer.Option(
|
|
85
|
+
300, "--timeout", help="Seconds to wait when --wait is used"
|
|
86
|
+
),
|
|
58
87
|
) -> None:
|
|
59
88
|
"""Rebase document timestamps in an operation using update_by_query."""
|
|
60
89
|
|
|
@@ -69,11 +98,13 @@ def rebase_by_query(
|
|
|
69
98
|
ws_id=client.ws_id,
|
|
70
99
|
offset_msec=offset_msec,
|
|
71
100
|
flt=flt_obj,
|
|
72
|
-
|
|
101
|
+
fields=fields,
|
|
73
102
|
wait=False,
|
|
74
103
|
)
|
|
75
104
|
req_id = result.get("req_id") if isinstance(result, dict) else None
|
|
76
|
-
timed_out = await _wait_for_stats_create(
|
|
105
|
+
timed_out = await _wait_for_stats_create(
|
|
106
|
+
client, [str(req_id)] if req_id else []
|
|
107
|
+
)
|
|
77
108
|
if timed_out:
|
|
78
109
|
print_warning(
|
|
79
110
|
f"Request did not receive STATS_CREATE within {_WS_CONFIRM_TIMEOUT_SEC:.0f}s: "
|
|
@@ -104,18 +135,30 @@ def rebase_by_query(
|
|
|
104
135
|
data = {}
|
|
105
136
|
total_hits = data.get("total_hits")
|
|
106
137
|
updated = data.get("updated")
|
|
107
|
-
if
|
|
108
|
-
|
|
109
|
-
|
|
138
|
+
if (
|
|
139
|
+
isinstance(total_hits, int)
|
|
140
|
+
and total_hits > 0
|
|
141
|
+
and isinstance(updated, int)
|
|
142
|
+
):
|
|
143
|
+
progress.update(
|
|
144
|
+
task_id,
|
|
145
|
+
total=total_hits,
|
|
146
|
+
completed=min(updated, total_hits),
|
|
147
|
+
)
|
|
148
|
+
progress.update(
|
|
149
|
+
task_id, description=f"rebase ({updated}/{total_hits})"
|
|
150
|
+
)
|
|
110
151
|
elif isinstance(updated, int):
|
|
111
|
-
progress.update(
|
|
152
|
+
progress.update(
|
|
153
|
+
task_id, description=f"rebase ({updated} updated)"
|
|
154
|
+
)
|
|
112
155
|
|
|
113
156
|
result = await client.db.rebase_by_query(
|
|
114
157
|
operation_id=operation_id,
|
|
115
158
|
ws_id=client.ws_id,
|
|
116
159
|
offset_msec=offset_msec,
|
|
117
160
|
flt=flt_obj,
|
|
118
|
-
|
|
161
|
+
fields=fields,
|
|
119
162
|
wait=False,
|
|
120
163
|
)
|
|
121
164
|
req_id = result.get("req_id") if isinstance(result, dict) else None
|
|
@@ -163,7 +206,9 @@ def refresh_index(
|
|
|
163
206
|
@app.command("delete-index")
|
|
164
207
|
def delete_index(
|
|
165
208
|
index: str,
|
|
166
|
-
keep_operation: bool = typer.Option(
|
|
209
|
+
keep_operation: bool = typer.Option(
|
|
210
|
+
False, "--keep-operation", help="Do NOT delete the associated collab operation"
|
|
211
|
+
),
|
|
167
212
|
yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation prompt"),
|
|
168
213
|
) -> None:
|
|
169
214
|
"""Delete an OpenSearch datastream/index and (by default) its collab operation. WARNING: all data will be lost."""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gulp-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Command-line client for gULP
|
|
5
5
|
Author-email: Mentat <info@mentat.is>
|
|
6
6
|
Requires-Python: >=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: typer
|
|
9
|
-
Requires-Dist: rich
|
|
10
|
-
Requires-Dist: click==8.
|
|
8
|
+
Requires-Dist: typer==0.23.1
|
|
9
|
+
Requires-Dist: rich==15.0.0
|
|
10
|
+
Requires-Dist: click==8.3.3
|
|
11
11
|
Requires-Dist: gulp-sdk
|
|
12
12
|
|
|
13
13
|
# 🚀 gulp-cli
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|