Data Generator doesn't set host field via token
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Start with pytest-splunk-addon-data.conf and the Test_App.test_indextime_key_fields test, comparing the two token configurations and the captured Splunk results. Trace how the host token and host_type are handled, then run the failing test. Done means the configured host token produces the expected IPv4 host values instead of Barracuda.log.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The following configuration in pytest-splunk-addon-data.conf does replace the tokens as expected, but the ingested data shows a value of Barracuda.logfor field host. Therefore test Test_App.test_indextime_key_fields fails.
[Barracuda.log]
sourcetype = barracuda
#source =
#sourcetype_to_search = barracuda
host_type = plugin
input_type = file_monitor
index = main
sample_count = 20
#expected_event_count =
timestamp_type = event
#breaker =
token.1.token = ##time1##
token.1.replacementType = timestamp
token.1.replacement = %b %d %H:%M:%S
token.1.field = _time
token.2.token = ##host##
token.2.replacementType = random
token.2.replacement = host["ipv4"]
token.2.field = host
token.3.token = ##time2##
token.3.replacementType = timestamp
token.3.replacement = %Y-%m%d %H:%M:%S.%3Q +%z
The following config using host_type = plugin produces the exact same result.
[Barracuda.log]
sourcetype = barracuda
#source =
#sourcetype_to_search = barracuda
host_type = plugin
input_type = file_monitor
index = main
sample_count = 20
#expected_event_count =
timestamp_type = event
#breaker =
token.1.token = ##time1##
token.1.replacementType = timestamp
token.1.replacement = %b %d %H:%M:%S
token.1.field = _time
token.2.token = ##host##
token.2.replacementType = random
token.2.replacement = host["ipv4"]
#token.2.field = host
token.3.token = ##time2##
token.3.replacementType = timestamp
token.3.replacement = %Y-%m%d %H:%M:%S.%3Q +%z
Test output:
---------------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------------
DEBUG pytest-splunk-addon:test_templates.py:80 Base search for indextime key field test: search (index=*) sourcetype=barracuda host IN ("Barracuda.log") | table host
DEBUG pytest-splunk-addon:test_templates.py:88 Results:[{'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}, {'host': 'Barracuda.log'}]
INFO pytest-splunk-addon:test_templates.py:143 Some values for the following key fields are missing
Key_field | Expected_values | Actual_values
--------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -----------------
host | {'172.16.51.6', '172.16.51.7', '172.16.51.3', '172.16.51.18', '172.16.51.12', '172.16.51.8', '172.16.51.17', '172.16.51.19', '172.16.51.10', '172.16.51.11', '172.16.51.1', '172.16.51.15', '172.16.51.4', '172.16.51.16', '172.16.51.0', '172.16.51.9', '172.16.51.5', '172.16.51.13', '172.16.51.2', '172.16.51.14'} | {'Barracuda.log'}
System information:
platform darwin -- Python 3.8.6, pytest-6.1.1, py-1.9.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.8
using: pytest-6.1.1 pylib-1.9.0
setuptools registered plugins:
lovely-pytest-docker-0.2.0 at /usr/local/lib/python3.8/site-packages/lovely/pytest/docker/compose.py
pytest-splunk-addon-1.3.9 at /usr/local/lib/python3.8/site-packages/pytest_splunk_addon/plugin.py
pytest-splunk-addon-1.3.9 at /usr/local/lib/python3.8/site-packages/pytest_splunk_addon/splunk.py
pytest-xdist-2.1.0 at /usr/local/lib/python3.8/site-packages/xdist/plugin.py
pytest-xdist-2.1.0 at /usr/local/lib/python3.8/site-packages/xdist/looponfail.py
pytest-forked-1.3.0 at /usr/local/lib/python3.8/site-packages/pytest_forked/__init__.py
Faker-4.14.0 at /usr/local/lib/python3.8/site-packages/faker/contrib/pytest/plugin.py
- Lingua principale
- Python
- Stelle
- 67
- Fork
- 19
- Merge medio
- 16h 48m
- PR unite (30g)
- 4
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di splunk/pytest-splunk-addon
-
sample_generation/rule.py randint() crashes under Python 3.13 (float args no longer accepted)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
splunk/pytest-splunk-addon#959 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
splunk/pytest-splunk-addon#967 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
splunk/pytest-splunk-addon#963 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
splunk/pytest-splunk-addon#895 ·
-
enhancement major
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
splunk/pytest-splunk-addon#549 ·
Tutte le issue di splunk/pytest-splunk-addon
Issue simili
-
[MOVIE]: Airport '77 (1977)Apertarequest-theme
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
LizardByte/ThemerrDB#9883 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Project-MONAI/MONAI#9258 ·
I maintainer di solito rispondono entro 3 giorni
-
catalog:deprecation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
surendranb/free-inference#31 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fritzprix/libr-agent#2612 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage presubmit-gate
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#5001 ·
I maintainer di solito rispondono entro 1 giorno