HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/tests/integration/__pycache__/helper.cpython-37.pyc
B

�P�e��	@sldZddlmZddlmZddlZdd�Zddd	d
ddd
ddg	ZdZddd�Z	dd�Z
dd�Zdd�ZdS)zAhelper functions for testing graypy with a local Graylog instance�)�sleep)�uuid4NcCs
tt��S)N)�strr�rr�I/opt/alt/python37/lib/python3.7/site-packages/tests/integration/helper.py�get_unique_messagesr�messageZfull_message�source�level�func�file�line�moduleZlogger_namezYhttp://127.0.0.1:9000/api/search/universal/relative?query=message:"{0}"&range=300&fields=cCs\|r|ng}d}xFytt||�|d�Stk
rRtd�|dkrF�|d7}YqXqWdS)zdSearch for a given log message (with possible additional fields)
    within a local Graylog instancer)�api_response�wanted_message���N)�_parse_api_response�_get_api_response�
ValueErrorr)r�fields�triesrrr�get_graylog_responsesrcCst�|�d�tt|��S)Nz%2C)�BASE_API_URL�format�join�set�DEFAULT_FIELDS)rrrrr�_build_api_string1srcCs"t||�}tj|dddid�}|S)N)�adminr �acceptzapplication/json)�auth�headers)r�requests�get)rr�urlrrrrr5s
rcCs\|jdkst�t|���x,|��dD]}|dd|kr(|dSq(Wtd�||���dS)N���messagesrz0wanted_message: '{}' not within api_response: {})�status_code�AssertionError�print�jsonrr)rrrrrrr=sr)N)
�__doc__�timer�uuidrr$rrrrrrrrrrr�<module>s$