在AWS Cloudwatch Logs Insights中处理单引号

时间:2019-10-19 13:17:58

标签: amazon-web-services aws-cloudwatch-log-insights

以下是一些包含单引号的文本:

select IFNULL((select  id, count(*) as v
from    (
        select id, s1 as val from t1
        union all select id, s2 from t1
        union all select id, s3 from t1
        union all select id, s4 from t1
        union all select id, s5 from t1
        ) sub
where   val = 3
group by id),0) as Valcount;

当我使用上面的文本运行下面的查询时

import pandas as pd


df = pd.DataFrame(
        {
         'user_id': [1, 1, 1, 2, 2, ],
         'title': ['t1', 't2', 't3', 't1', 't5'],
         'rating': [25, 25, 35, 25, 30,],
        })


df.sort_values(by='rating', ascending=False).groupby('user_id')[['user_id', 'title','rating', ]].nth(list(range(30)))

我无法计数。但是,实际上,我的日志中有很多上述文本。

问题是,如何在查询中转义单引号?

1 个答案:

答案 0 :(得分:1)

您需要对引号\'进行转义。
像这样:
 /Cannot read property \'email\' of undefined/