Hi Team,
Could you please suggest the below requirement.
using the below server log, i just want only the order_id with combination of customer name , error code value as 5000111 & amount value using the shell script
i tired using the command
grep "error_code>50001111" server.log.2019-01-27 |awk -F"order_id" '{print $2}' |awk -F">" '{print $2}' |awk -F"<" '{print $1}'
After using the command, i got the below output.
10239, Simon MEREDITH HARDY|1548550739844
server.log
response: <transaction>
<on_test_gateway type="boolean">false</on_test_gateway> <created_at type="dateTime">2019-01-27T00:59:00Z</created_at>
<updated_at type="dateTime">2019-01-27T00:59:01Z</updated_at> <succeeded type="boolean">false</succeeded>
<state>gateway_processing_failed</state> <token>15789589</token>
<transaction_type>Purchase</transaction_type> <order_id>154896, Simon MEREDITH HARDY|1548550739844</order_id>
<ip nil="true"/> <description nil="true"/> <email nil="true"/> <merchant_name_descriptor nil="true"/>
<merchant_location_descriptor nil="true"/> <gateway_specific_fields nil="true"/> <gateway_specific_response_fields>
</gateway_specific_response_fields> <gateway_transaction_id>0</gateway_transaction_id> <gateway_latency_ms type="integer">717</gateway_latency_ms>
<amount type="integer">1150</amount> <currency_code>EUR</currency_code> <retain_on_success type="boolean">false</retain_on_success> <payment_method_added type="boolean">false</payment_method_added> <message></message>
<gateway_token>A11011452578589</gateway_token> <gateway_type>ogone</gateway_type> <shipping_address> <name>S P MEREDITH HARDY</name>
<address1 nil="true"/> <address2 nil="true"/> <city nil="true"/> <state nil="true"/> <zip nil="true"/> <country nil="true"/>
<phone_number nil="true"/> </shipping_address> <response> <success type="boolean">false</success> <message></message> <avs_code nil="true"/>
<avs_message nil="true"/> <cvv_code nil="true"/> <cvv_message nil="true"/> <pending type="boolean">false</pending> <result_unknown type="boolean">false</result_unknown>
<error_code>50001111</error_code> <error_detail nil="true"/> <cancelled type="boolean">false</cancelled> <fraud_review nil="true"/> <created_at type="dateTime">2019-01-27T00:59:01Z</created_at>
<updated_at type="dateTime">2019-01-27T00:59:01Z</updated_at> </response> <api_urls> </api_urls> <payment_method> <token>A11011452578589</token>