Hi,
I just statred using LUA for NginX. I have tough time using ngx_lua functions.
What method should I use to capture the certain string from the "API request's body"
---------------------------------------------------------------------------------------------------------------------------
Headers:
DFM-Application-Id: ZaXIZrKT
Dfm-Device-id: android1
DFM-Timestamp: 1489582211
DFM-SHA256-Verifier: 313ecbcb52ef7e09f9fb548325f3530619eb90821db5c880ec3c3b3ca18847c6
Content-Type: application/json
dfm_test: true
Body:
-------
[ {
"app_id": "sm_id,
"urlType": "UL",
"event_type": "deeplink_event",
"timezone_offset": 19800,
"timestamp": 1488783314,
"sdk_version": "4.0.1",
"url": "https:/url",
"event_seq": 18,
"custom_fields": {},
"platform": "ios",
"is_first": false,
"ts": 14887njn83314945,
"session_id": 148ubbd8783307944
}]
--------------------------------------------------------------------------------------------------------------------
In the body I want to capture "sdk_version": "4.0.1" . If there is match I have to divert the traffic to certain cluster else to other cluster.
I have tried using " body_filter_by_lua', but failed.
Thanks,
Bala