I have a log that contains the following output in the message field:
>>>>>>>>
POST /score/req/api/v1/coupon/create.json HTTP/1.1
Host: madlen.homewaffle.com
cookie: lunetics_locale=cs
accept-encoding: gzip
content-type: application/json; charset=UTF-8
x-mb-user-verify-registration-token: elSwaNvwSDaEB750_VHxUU:APA91bHh0E5XkgPgjcqfb5JXLy4OQLVVKs-vbEUJ-haJiGNI6o_MUbZ_TGpONxASKXyhc6i49iGZE6WoETL-8QJyAU8Nsm1DcgtXCT_7J6lKypyoVHTRwLFHUYHpBtIhhk7g-iGqioBn
authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJyb2xlcyI6WyJST0xFX1VTRVIiXSw******bygcKEV7balTr5OOHOpTr7k6l5h1g5SDo7s8qY3PBoz1iUlM2Ud9cdOyljI
x-request-mobile: 1
user-agent: android/33/Xiaomi/23028RN4DG
version: 6.7
x-client-session: 46c6a07fd2f14574c0558bfb940206d2
x-client-device-id: 51cbf963e13df9b3f62a90524ca4aa10
x-client-device: 33/Xiaomi/23028RN4DG
x-client-platform: android
x-client-version: 6.7
x-client-name: android-com
accept-language: cs
content-length: 160
x-request-id: 96b968c8b489d56457335d5f4cd3d64d
x-forwarded-for: 89.24.50.233
x-trusted-client: false
x-php-ob-level: 1
x-original-host: 2y733kjtq8apk.com
x-user-id: 172580987
{"acceptOdds":"3","amount":800.0,"bets":[{"is_exclusive_odds":false,"odd":4.1,"outcome_id":4532693575}],"isFree":false,"promoActivationKey":"","type":"ordinar"}
<<<<<<<<
HTTP/1.1 200 OK
transfer-encoding: chunked
content-type: application/json
x-w-id: 28331d01-7f6f-4e6f-84dc-ad1a60df3448
vary: accept-encoding
date: Fri, 17 May 2024 06:06:22 GMT
strict-transport-security: max-age=15768000
x-encoded-content-encoding: gzip
{"description":{"rate-limit-by-x-user-id-coupon-create":"pass","known-x-client-name-coupon-create":"pass"},"score":{"without_weight":100.0,"weighted":100.0,"weighted_softmax":100.0}}
--------
NULL
I need to parse only part of the fields from a given field:
- Host:
- x-user-id:
- each field in {“description”:{“rate-limit-by-x-user-id-coupon-create”:”pass”,”known-x-client-name-coupon-create”:”pass”},”score”:{“without_weight”:100.0,”weighted”:100.0,”weighted_softmax”:100.0}}
This is what i trying to do:
- type: log
enabled: true
paths:
- /var/log/project_log/general_info.json
processors:
tokenizer: '%{Host} %{x-user-id}'
field: "message"
overwrite_keys: true
target_prefix: ''
but the output remained the same and did not change
New contributor
Omar Tulashvili is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.