数据加工nginx的日志增加了request_body参数进入到日志,怎么进行数据加工取出其中的一个参数?

    日志格式:

    1. 例如是这样的格式的:
    2. {\x22pid\x22:\x22NIYOMOGS85R331OP\x22,\x22app\x22:{\x22pkg_version\x22:\x223.0.6\x22,\x22bundle\x22:\x22com.iqinbao.android.rabbit\x22,\x22name\x22:\x22\xE5\x84\xBF\xE6\xAD\x8C\xE5\xA4\xA7\xE5\x85\xA8100\xE9\xA6\x96\x22},\x22imp\x22:{\x22ad_type\x22:1,\x22aw\x22:1080,\x22ah\x22:1920},\x22version\x22:\x221.0.2\x22,\x22device\x22:{\x22oaid\x22:\x22\x22,\x22os\x22:2,\x22mac\x22:\x2244:9E:F9:D3:8A:71\x22,\x22rh\x22:1520,\x22rw\x22:720,\x22made_in\x22:\x22vivo\x22,\x22root\x22:0,\x22android_md5\x22:\x22485d542e9d41b94396c52e75ceaad612\x22,\x22source_direction\x22:1,\x22android\x22:\x22764fc602e6b8104a\x22,\x22ipv4\x22:\x22223.243.69.255\x22,\x22os_version\x22:\x2228\x22,\x22sw\x22:720,\x22sh\x22:1520,\x22geo\x22:{\x22lat\x22:41.90922,\x22long\x22:122.61043,\x22coordinate\x22:0},\x22network\x22:1,\x22imei_md5\x22:\x229f52548887b69be3d21832171c704aec\x22,\x22imei\x22:\x22868452039260231\x22,\x22density\x22:2,\x22device_type\x22:6,\x22ssid\x22:\x22\x22,\x22imsi\x22:\x22\x22,\x22model\x22:\x22X21A\x22,\x22brand\x22:\x22vivo\x22,\x22ua\x22:\x22Mozilla\x5C/5.0 (Linux; Android 9; vivo X21A Build\x5C/PKQ1.180819.001; wv) AppleWebKit\x5C/537.36 (KHTML, like Gecko) Version\x5C/4.0 Chrome\x5C/68.0.3440.91 Mobile Safari\x5C/537.36 mojia\x5C/1008050202\x22,\x22operator\x22:\x2246000\x22},\x22app_id\x22:\x22VIJY92Y3RUR3AX94\x22,\x22request_id\x22:\x2251c61ce843b6540d4f510368e62c99a2\x22}

    这个数据应该是unicode转义后的JSON,可以使用数据加工处理一次,再做查询。加工代码

    1. e_set(
    2. "content",
    3. str_decode(
    4. str_encode(
    5. str_decode(str_encode(v("content"), "latin1"), "unicode_escape"), "latin1",
    6. ),
    7. "utf8",
    8. ),
    9. )