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.
Files changed (50) hide show
  1. {gulp_cli-1.0.6/src/gulp_cli.egg-info → gulp_cli-1.0.8}/PKG-INFO +4 -4
  2. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/examples.md +7 -2
  3. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/pyproject.toml +3 -3
  4. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/_version.py +3 -3
  5. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/db.py +60 -15
  6. {gulp_cli-1.0.6 → gulp_cli-1.0.8/src/gulp_cli.egg-info}/PKG-INFO +4 -4
  7. gulp_cli-1.0.8/src/gulp_cli.egg-info/requires.txt +4 -0
  8. gulp_cli-1.0.6/src/gulp_cli.egg-info/requires.txt +0 -4
  9. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/.github/workflows/python-package.yml +0 -0
  10. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/.gitignore +0 -0
  11. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/README.md +0 -0
  12. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/command-reference.md +0 -0
  13. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/extensions.md +0 -0
  14. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/getting-started.md +0 -0
  15. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/resource-management.md +0 -0
  16. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/docs/troubleshooting-cli.md +0 -0
  17. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/setup.cfg +0 -0
  18. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/__init__.py +0 -0
  19. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/__main__.py +0 -0
  20. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/cli.py +0 -0
  21. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/client.py +0 -0
  22. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/__init__.py +0 -0
  23. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/acl.py +0 -0
  24. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/auth.py +0 -0
  25. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/collab.py +0 -0
  26. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/context.py +0 -0
  27. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/enhance_map.py +0 -0
  28. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/glyph.py +0 -0
  29. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/ingest.py +0 -0
  30. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/mapping.py +0 -0
  31. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/operations.py +0 -0
  32. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/plugin.py +0 -0
  33. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/query.py +0 -0
  34. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/source.py +0 -0
  35. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/stats.py +0 -0
  36. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/storage.py +0 -0
  37. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/user_group.py +0 -0
  38. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/commands/users.py +0 -0
  39. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/config.py +0 -0
  40. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/__init__.py +0 -0
  41. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/query_sigma_zip.py +0 -0
  42. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension/story.py +0 -0
  43. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extension_helpers.py +0 -0
  44. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/extensions.py +0 -0
  45. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/output.py +0 -0
  46. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli/utils.py +0 -0
  47. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/SOURCES.txt +0 -0
  48. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/dependency_links.txt +0 -0
  49. {gulp_cli-1.0.6 → gulp_cli-1.0.8}/src/gulp_cli.egg-info/entry_points.txt +0 -0
  50. {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.6
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>=0.12.5
9
- Requires-Dist: rich>=13.7.1
10
- Requires-Dist: click==8.1.7
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>=0.12.5",
19
- "rich>=13.7.1",
20
- "click==8.1.7",
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.6'
22
- __version_tuple__ = version_tuple = (1, 0, 6)
21
+ __version__ = version = '1.0.8'
22
+ __version_tuple__ = version_tuple = (1, 0, 8)
23
23
 
24
- __commit_id__ = commit_id = 'gefa054d5d'
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 BarColumn, Progress, SpinnerColumn, TaskProgressColumn, TextColumn, TimeElapsedColumn
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 console, print_json, print_warning, print_result
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(asyncio.gather(*[ev.wait() for ev in events.values()]), timeout=timeout)
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(..., "--offset-msec", help="Milliseconds to add to timestamps (negative to subtract)"),
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
- script: str | None = typer.Option(None, "--script", help="Custom Painless script override"),
56
- wait: bool = typer.Option(False, "--wait", help="Wait for rebase completion with websocket-driven progress"),
57
- wait_timeout: int = typer.Option(300, "--timeout", help="Seconds to wait when --wait is used"),
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
- script=script,
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(client, [str(req_id)] if req_id else [])
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 isinstance(total_hits, int) and total_hits > 0 and isinstance(updated, int):
108
- progress.update(task_id, total=total_hits, completed=min(updated, total_hits))
109
- progress.update(task_id, description=f"rebase ({updated}/{total_hits})")
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(task_id, description=f"rebase ({updated} updated)")
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
- script=script,
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(False, "--keep-operation", help="Do NOT delete the associated collab operation"),
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.6
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>=0.12.5
9
- Requires-Dist: rich>=13.7.1
10
- Requires-Dist: click==8.1.7
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
@@ -0,0 +1,4 @@
1
+ typer==0.23.1
2
+ rich==15.0.0
3
+ click==8.3.3
4
+ gulp-sdk
@@ -1,4 +0,0 @@
1
- typer>=0.12.5
2
- rich>=13.7.1
3
- click==8.1.7
4
- gulp-sdk
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes