Hi,
I was trying to fetch below fileds from the log
2024-01-10 04:21:52.018 -06:00 [INF] [2696100223720240110042151-10] {"Message":"Device_Response_2696100223720240110042151-10","ApiEndPoint":"ws://10.136.41.18:50000/","ResponseCode":"","Store":"2696","Terminal":"100","TransactionId":"2237","CorrelationId":"2696100223720240110042151-10","RequestPayload":"{"request":{"resource":{"type":"info"},"flow_id":"2696100223720240110042151-10","endpoint":"/upp/v1/device"}","ResponsePayload":"{"response" : {"endpoint" : "/upp/v1/device","flow_id" : "2696100223720240110042151-10","resource" : {"status" : "completed","unit_data" : {"application" : "Unified Payment Platform","battery" : {"battery_charging_state" : "NotAvailable","battery_level" : "N/A"},"contactless_emv" : {"config" : "/HOST/EMVCLESS.XML","contactless_interface_support" : "Yes","discover_kernel_version" : "020000","expresspay_v2_kernel_version" : "NONE","expresspay_v3_kernel_version" : "070100","interac_kernel_version" : "020500","jspeedy_kernel_version" : "040300","paypass_v3_app_version" : "030700","paypass_v3_kernel_version" : "090200","upi_kernel_version" : "040700","visa_paywave_kernel_version" : "070803"},"emv" : {"config" : "/HOST/EMVCONTACT.XML","engine_version" : "063400","kernel_version" : "090600"},"general" : {"device_model" : "L7000","ecr_no" : "3456","manufacture" : "INGNAR","manufacture_serial_no" : "24694446","unit_serial_no" : "3011295624694446"},"memory" : {"flash_size" : "491040","ram_size" : "506116"},"transaction" : {"cashback_limit" : "999999"},"version" : {"application_version" : "7.83.27-0022","digitizer_version" : "0000","eftl_version" : "0100","eftp_version" : "0100","os_version" : "0506","pci_version" : "0.0.0.0.00.00-0000","security_module_version" : "0508"}}}","TimeTaken":"00:00:00.3931037","TimeStamp":null,"Exception":null,"LogLevel":"Information","LogLevelEnum":2}
Fields to fetch:
- Terminal
- Apiendpoint
- store
- application version
- transaction id
Wrote a grok pattern like below
%{TIMESTAMP_ISO8601:app_timestamp}%{SPACE}%{GREEDYDATA}\]%{SPACE}%{GREEDYDATA:response}RequestPayload%{GREEDYDATA}application_version%{GREEDYDATA:application_version}digitizer_version
Grok Simulate:
{
"response": "{\"Message\":\"Device_Response_2696100223720240110042151-10\",\"ApiEndPoint\":\"ws://10.136.41.18:50000/\",\"ResponseCode\":\"\",\"Store\":\"2696\",\"Terminal\":\"100\",\"TransactionId\":\"2237\",\"CorrelationId\":\"2696100223720240110042151-10\",\"",
"app_timestamp": "2024-01-10 04:21:52.018",
"application_version": "\" : \"7.83.27-0022\",\""
How can I get the
- Terminal
- Apiendpoint
- store
- transaction id
using mutate and gsub?