<div dir="ltr"><div>I need to post a JSON object to Elsasticsearch, and I am using Redis as a queue via cache_raw_query and the RPUSH command. The JSON object contains spaces, which appears to cause the OpenSIPS Redis client to break the string into pieces and push each of them to Redis separately.<br></div><div><br></div><div>1. Maybe I'm not quoting correctly?</div><div>RPUSH snarf-cdrs 'object_goes_here'<br></div><div><br></div><div>It doesn't seem to matter if I enclose the Resid list value in single quotes or not.</div><div><br></div><div>I initially resolved this problem by escaping spaces with their escaped Unicode equivalent. This has the desired result in Elasticsearch, but now my JSON object is bigger and the regex replacement fails. Is there a workaround?</div><div><br></div><div>$var(replaceSpace) = "/ /\\\u00a0/sg";<br></div><div>$avp(body) = $(json_compact(body){re.subst,$var(replaceSpace)});<br></div><div><br></div><div><font face="monospace">DBG:core:tr_eval_re: Trying to apply regexp [/ /\\u00a0/sg] on : [{"index":"snarf-2021.04.03","time":"2021-04-03T03:34:18","TID":"006508","BLOCKED":1,"SVCPORT":"8.38.43.182","CALLID":"bf0ea503853749618c747a995b7f0102","SOURCEIP":"192.168.47.130","MEDIAIP":"192.168.47.130","ANI":"2132850555","DNIS":"2132850555","SNARF":"NONE","FRAUD":0,"TCPA":0,"NEIGHLATA":"1","NEIGHRC":"1","NEIGHBLOCK":"1","NEIGHPREFIX":"1","ATFN":0,"BTFN":0,"ALRN":"2132620105","AState":"CA","ANetwork":"<a href="http://BANDWIDTH.COM" target="_blank">BANDWIDTH.COM</a> CLEC- LLC - CA","AOCN":"979E","ARatecenter":"LSAN DA 01","AClass":"L","ALATA":"730","ACountry":"US","AReachable":"1","AReason":"SS7 ID","ADNC":"0","AGood":"1","ADNO":"0","BLRN":"2132620105","BState":"CA","BNetwork":"<a href="http://BANDWIDTH.COM" target="_blank">BANDWIDTH.COM</a> CLEC- LLC - CA","BOCN":"979E","BRatecenter":"LSAN DA 01","BClass":"L","BLATA":"730","BCountry":"US","BReachable":"1","BReason":"SS7 ID","BDNC":"0","BGood":"1","BDNO":"0","TRIGGERS":["neighBlock"],"RULES":{"tid":"006508","rep":"none","fraud":0,"tcpa":95,"aclass":false,"adno":false,"atfn":false,"bclass":false,"bdnc":false,"bgood":false,"neighBlock":true,"neighLata":false,"neighRc":false,"neighPrefix":false}}]<br>Apr  3 03:34:18 ve-lab /usr/sbin/opensips[14291]: DBG:core:tr_eval_re: we must compile the regexp<br>Apr  3 03:34:18 ve-lab /usr/sbin/opensips[14291]: DBG:core:subst_parser: ok, se is 0x7f8737c1f0e8<br>Apr  3 03:34:18 ve-lab /usr/sbin/opensips[14291]: ERROR:core:tr_eval_re: regex value too long [{"index":"snarf-2021.04.03","time":"2021-04-03T03:34:18","TID":"006508","BLOCKED":1,"SVCPORT":"8.38.43.182","CALLID":"bf0ea503853749618c747a995b7f0102","SOURCEIP":"192.168.47.130","MEDIAIP":"192.168.47.130","ANI":"2132850555","DNIS":"2132850555","SNARF":"NONE","FRAUD":0,"TCPA":0,"NEIGHLATA":"1","NEIGHRC":"1","NEIGHBLOCK":"1","NEIGHPREFIX":"1","ATFN":0,"BTFN":0,"ALRN":"2132620105","AState":"CA","ANetwork":"<a href="http://BANDWIDTH.COM" target="_blank">BANDWIDTH.COM</a> CLEC- LLC - CA","AOCN":"979E","ARatecenter":"LSAN DA 01","AClass":"L","ALATA":"730","ACountry":"US","AReachable":"1","AReason":"SS7 ID","ADNC":"0","AGood":"1","ADNO":"0","BLRN":"2132620105","BState":"CA","BNetwork":"<a href="http://BANDWIDTH.COM" target="_blank">BANDWIDTH.COM</a> CLEC- LLC - CA","BOCN":"979E","BRatecenter":"LSAN DA 01","BClass":"L","BLATA":"730","BCountry":"US","BReachable":"1","BReason":"SS7 ID","BDNC":"0","BGood":"1","BDNO":"0","TRIGGERS":["neighBlock"],"RULES":{"tid":"006508","rep":"none","fraud":0,"tcpa":95,"aclass":false,"adno":false,"atfn":false,"bclass":false,"bdnc":false,"bgood":false,"neighBlock":true,"neighLata":false,"neighRc":false,"neighPrefix":false}}]</font><br></div><div><br></div><div>opensips 3.1.1<br></div><div>Ubuntu 18.04.5 LTS<br></div><div>Linux ve-lab 4.15.0-140-generic #144-Ubuntu SMP Fri Mar 19 14:12:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux<br></div><div></div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Regards,<div><br></div><div><p style="font-family:helvetica,arial,sans-serif;font-size:12px;margin:0px;padding:0px 0px 20px;color:rgb(0,0,0)"><strong>Calvin Ellison</strong><br>Systems Architect<br><a href="mailto:calvin.ellison@voxox.com" style="text-decoration:none;color:rgb(14,123,174)" target="_blank">calvin.ellison@voxox.com</a><br></p></div></div></div></div></div></div></div></div></div></div></div></div></div>