Skip to content

Commit

Permalink
refactor jsonl connector
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Aug 12, 2024
1 parent 78d4476 commit 1292dd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/exampledata/config/http_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
process_count: 2
config_refresh_interval: 10

profile_pipelines: false
logger:
level: INFO
loggers:
Expand Down
5 changes: 2 additions & 3 deletions logprep/connector/http/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ class JSONLHttpEndpoint(HttpEndpoint):
async def __call__(self, req, resp, **kwargs): # pylint: disable=arguments-differ
"""jsonl endpoint method"""
self.collect_metrics()
data = await self.get_data(req)
metadata = kwargs.get("metadata", {})
for event in self._decoder.decode_lines(data):
metadata = kwargs.get("metadata", dict())
for event in self._decoder.decode_lines(await self.get_data(req)):
self.messages.put(event | metadata, block=False)


Expand Down

0 comments on commit 1292dd1

Please sign in to comment.