tellaro-query-language 0.2.8__py3-none-any.whl → 0.2.10__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tellaro-query-language
3
- Version: 0.2.8
3
+ Version: 0.2.10
4
4
  Summary: A flexible, human-friendly query language for searching and filtering structured data
5
5
  License: Proprietary
6
6
  License-File: LICENSE
@@ -9,7 +9,7 @@ tql/core.py,sha256=_OlFGTrvJ8cBz3OliRxSz-IbD6e1t_nYC5YZFVkOAfc,58413
9
9
  tql/core_components/README.md,sha256=Rm7w4UHdQ0vPBEFybE5b62IOvSA5Nzq2GRvtBHOapmc,3068
10
10
  tql/core_components/__init__.py,sha256=v8BBybPlqV7dkVY9mw1mblvqyAFJZ7Pf_bEc-jAL7FI,643
11
11
  tql/core_components/file_operations.py,sha256=Jr0kkxz_OP2KHOAsIr7KMtYe_lbu8LuBUySt2LQbjJw,3925
12
- tql/core_components/opensearch_operations.py,sha256=zgxGiDpXyPW0ZUX-StpZXxf84s8eLxSymAGM5UUJimk,55253
12
+ tql/core_components/opensearch_operations.py,sha256=gj5u_WG0PIfIBcxat4VaTViHJbL5AGJq4rgIxaES8hg,55307
13
13
  tql/core_components/stats_operations.py,sha256=aqTGAqIFvR6EkSbJEd0qft8Ldy8uiTrK2XI9o5bZUOs,8014
14
14
  tql/core_components/validation_operations.py,sha256=_VPXh0HABBjsXF99jFT7B6-5QAPsADOCy6poinGrxeE,22454
15
15
  tql/evaluator.py,sha256=6BtC0njH_aR_lXiU6GU5vM5MRhQeSoxL7F95xh-2-ho,17903
@@ -24,7 +24,7 @@ tql/geoip_normalizer.py,sha256=tvie-5xevJEeLp2KmjoXDjYdND8AvyVE7lCO8qgUzGY,10486
24
24
  tql/mutator_analyzer.py,sha256=OWx3k5lK5aFHWU9Ez6DaIhenEZDxj9CbB0vM71xqUTw,55670
25
25
  tql/mutators/__init__.py,sha256=eTK8sRw4KXXnTZTn5ETIqwcaIek5rSUIVyZsxTwNNHA,6966
26
26
  tql/mutators/base.py,sha256=4Ze_x1sTO11OILXfcF2XN7ttyHcZ4gwn96UXFMMaC6M,2523
27
- tql/mutators/dns.py,sha256=1IKgHolFLRMR4TOgK0AiLjz5vDtFiqO328mVF4Vzk3s,14428
27
+ tql/mutators/dns.py,sha256=E4JmEyfZJO7OKpMsCb_jM-79xcQRcuEjzQSMBpRuNXo,15987
28
28
  tql/mutators/encoding.py,sha256=yt12BJrHAIJfBesP8VOSfVlvJqB1yOmEeT_8QDPvNN8,7985
29
29
  tql/mutators/geo.py,sha256=H-_5oDvuYaAG8Re17RkGjzCc6Z07YHd7Cr95g6JbnyE,16188
30
30
  tql/mutators/list.py,sha256=949ZrKKhL4INkH2Od8bq7Ey80kFX_23PEfRKueG82cU,7084
@@ -52,8 +52,8 @@ tql/stats_evaluator.py,sha256=2qnjeH5Qx14qpHDS_YJn9jRPeoPUfkeiYJabBagdfRs,36126
52
52
  tql/stats_transformer.py,sha256=MT-4rDWZSySgn4Fuq9H0c-mvwFYLM6FqWpPv2rHX-rE,7588
53
53
  tql/streaming_file_processor.py,sha256=cftWhYcvUo984P3ALf2CO3FoCQPJPe_2s2HLcXTp5UQ,12437
54
54
  tql/validators.py,sha256=e9MlX-zQ_O3M8YP8vXyMjKU8iiJMTh6mMK0iv0_4gTY,3771
55
- tellaro_query_language-0.2.8.dist-info/METADATA,sha256=NwgXSoSzBB6oDL-aBxAnjwB46BWYiwbi_D16TMoBjE8,21891
56
- tellaro_query_language-0.2.8.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
57
- tellaro_query_language-0.2.8.dist-info/entry_points.txt,sha256=D0lbIGUYuDyfcYeqju1rWcMBFzft4sZtfIlw5uPNx5g,181
58
- tellaro_query_language-0.2.8.dist-info/licenses/LICENSE,sha256=eWf8lkuXlVX_8WiDpUgQvzxc1cxCeVne_e6P-pVJpwM,3038
59
- tellaro_query_language-0.2.8.dist-info/RECORD,,
55
+ tellaro_query_language-0.2.10.dist-info/METADATA,sha256=4hZ9XRUa0FjMZi6URvcfy5Iapazvj8Mn17o-q-UspM4,21892
56
+ tellaro_query_language-0.2.10.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
57
+ tellaro_query_language-0.2.10.dist-info/entry_points.txt,sha256=D0lbIGUYuDyfcYeqju1rWcMBFzft4sZtfIlw5uPNx5g,181
58
+ tellaro_query_language-0.2.10.dist-info/licenses/LICENSE,sha256=eWf8lkuXlVX_8WiDpUgQvzxc1cxCeVne_e6P-pVJpwM,3038
59
+ tellaro_query_language-0.2.10.dist-info/RECORD,,
@@ -813,10 +813,10 @@ class OpenSearchOperations:
813
813
  # scan_all mode with post-processing - process all results
814
814
  processor = QueryPostProcessor()
815
815
 
816
- # Extract all documents from hits
816
+ # Extract all documents from initial_hits (which contains all scrolled results)
817
817
  documents = []
818
818
  hit_metadata = []
819
- for hit in hits:
819
+ for hit in initial_hits:
820
820
  documents.append(hit["_source"])
821
821
  hit_metadata.append(
822
822
  {
tql/mutators/dns.py CHANGED
@@ -246,20 +246,53 @@ class NSLookupMutator(BaseMutator):
246
246
 
247
247
  # Save enrichment if requested
248
248
  if save_enrichment:
249
- # Always store ECS data directly, never use IP addresses as field names
249
+ # Determine the DNS data field (for full ECS structure)
250
+ # If append_field is like "destination.domain", dns_field is "destination.dns"
251
+ if append_field.endswith(".domain"):
252
+ dns_field = append_field.rsplit(".domain", 1)[0] + ".dns"
253
+ elif append_field == "domain":
254
+ dns_field = "dns"
255
+ else:
256
+ dns_field = append_field + "_dns"
257
+
250
258
  if len(queries) == 1 and queries[0] in resolved_results:
251
- # Single query: store the ECS data directly
252
- append_to_result(record, append_field, resolved_results[queries[0]])
259
+ # Single query: extract domain names for the domain field
260
+ dns_data = resolved_results[queries[0]]
261
+ answers = dns_data.get("answers", [])
262
+
263
+ # Store domain name(s) in the domain field (string or list of strings)
264
+ if len(answers) == 1:
265
+ append_to_result(record, append_field, answers[0])
266
+ elif len(answers) > 1:
267
+ append_to_result(record, append_field, answers)
268
+ # If no answers, don't set the domain field (leave it unset)
269
+
270
+ # Store full ECS data in the dns field
271
+ append_to_result(record, dns_field, dns_data)
272
+
253
273
  elif len(queries) > 1:
254
- # Multiple queries: store as array of ECS results
274
+ # Multiple queries: collect all domain names and ECS results
275
+ all_domains = []
255
276
  results_array = []
256
277
  for query in queries:
257
278
  if query in resolved_results:
258
- results_array.append(resolved_results[query])
259
- append_to_result(record, append_field, results_array)
260
- else:
261
- # No results
262
- append_to_result(record, append_field, None)
279
+ dns_data = resolved_results[query]
280
+ results_array.append(dns_data)
281
+ answers = dns_data.get("answers", [])
282
+ all_domains.extend(answers)
283
+
284
+ # Store unique domain names in the domain field
285
+ if all_domains:
286
+ unique_domains = list(dict.fromkeys(all_domains)) # Preserve order, remove dupes
287
+ if len(unique_domains) == 1:
288
+ append_to_result(record, append_field, unique_domains[0])
289
+ else:
290
+ append_to_result(record, append_field, unique_domains)
291
+
292
+ # Store full ECS data array in the dns field
293
+ if results_array:
294
+ append_to_result(record, dns_field, results_array)
295
+ # If no results, don't set any fields
263
296
 
264
297
  # For enrichment mutators, return data for comparison
265
298
  # The full enrichment data is stored via append_to_result above