你不会是程序猿吧?

logstash在处理长日志时日志被截断

Logstash | 作者 angelo | 发布于2021年07月08日 | 阅读数:2376

logstash 在解析json格式日志时,对传入的日志文件字段大小有限制?
报错如下:
[2021-07-08T16:55:43,577][WARN ][logstash.filters.json ][main][ea8d87039fd02fadc10d4a34509a1128458fa2d75e9478a0def838a0f6b0c9f6] Error parsing json {:source=>"log", :raw=>"{\"@local_time\":\"2021-07-08 16:55:42.612\",\"@log_entry\":\"benlai://srv.xxx.cn/ProductList/GetList,\\ninput-->{\\\"productSysNoList\\\":[585990,412486,586316,348552,406201,598617,487632,474470,387408,373924,494758,337591,332717,335380,331565,363538,362219,283212,332722,295944],\\\"toWebSiteSysNo\\\":1,\\\"IncludeInventoryQuantity\\\":true,\\\"AreaSysNo\\\":561,\\\"trackId\\\":\\\"Benlai.Api.WebApi-0ac97e13_1-451592-171604\\\",\\\"userIp\\\":\\\"221.192.179.52\\\",\\\"appId\\\":3918,\\\"clientSource\\\":2};\\noutput-->{\\\"Code\\\":100,\\\"Msg\\\":\\\"ok\\\",\\\"Value\\\":[{\\\"ProductSysNo\\\":585990,\\\"ProductBasicSysNo\\\":166123,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"【预售】新疆吐鲁番火焰无核葡萄 2kg/箱\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/b571f2f6-1774-46aa-b786-5ed3b7271e70.jpg\\\",\\\"PromotionWord\\\":\\\"\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":229,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-513,\\\"StockQty\\\":487,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":69.900000,\\\"Price\\\":69.900000,\\\"OrigPrice\\\":129.000000,\\\"GuidePrice\\\":129.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":412486,\\\"ProductBasicSysNo\\\":107105,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"【预售】美国西北红车厘子2磅(约908g,果径26mm+)\\\",\\\"ImageUrl\\\":\\\"/ProductImages/000/000/412/463/medium/6afeba31-d207-4192-9a58-9c87b56ffaec.jpg\\\",\\\"PromotionWord\\\":\\\"众筹包机直达  鲜上眉梢\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":false,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-923,\\\"StockQty\\\":1077,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":[\\\"/Product/Tag/f4da43c1-2e10-4221-a7ee-1d4f25a5b1bc.jpg\\\"],\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":229.000000,\\\"Price\\\":229.000000,\\\"OrigPrice\\\":229.000000,\\\"GuidePrice\\\":229.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":586316,\\\"ProductBasicSysNo\\\":49087,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"新疆空运小白杏1.5kg装\\\",\\\"ImageUrl\\\":\\\"/ProductImages/000/000/055/539/medium/9de75279-41fd-4edb-97fa-e0f19b242fd6.jpg\\\",\\\"PromotionWord\\\":\\\"小白杏放置颜色发黄口感更佳,青涩略带酸。\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":false,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":229,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":24,\\\"StockQty\\\":24,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":79.000000,\\\"Price\\\":79.000000,\\\"OrigPrice\\\":138.000000,\\\"GuidePrice\\\":138.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":348552,\\\"ProductBasicSysNo\\\":82476,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"佳沛新西兰阳光金奇异果原箱3.3kg(25-27头)\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/f4372daf-3cf9-4b3b-bf0b-9c8b3ec815d4.jpg\\\",\\\"PromotionWord\\\":\\\"巨大果--甜蜜爆汁,大口吃到爽,每天一颗活力四射\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":false,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":25,\\\"StockQty\\\":1055,\\\"PromotionsTags\\\":[\\\"返券\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":[\\\"/Product/Tag/d10f8f7b-57f2-4564-8493-ec8afbda3256.png\\\"],\\\"ProductPrice\\\":{\\\"Type\\\":1,\\\"BasicPrice\\\":379.000000,\\\"Price\\\":349.000000,\\\"OrigPrice\\\":389.000000,\\\"GuidePrice\\\":389.000000,\\\"StartTime\\\":\\\"2021-07-07T00:00:00\\\",\\\"EndTime\\\":\\\"2021-07-09T23:59:59\\\"},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":406201,\\\"ProductBasicSysNo\\\":104308,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"美国新奇士黑标晚熟脐橙20个装(3kg+)\\\",\\\"ImageUrl\\\":\\\"/ProductImages/000/000/406/199/medium/9707b07e-7018-433a-90c2-825ee122fc86.jpg\\\",\\\"PromotionWord\\\":\\\"加州阳光尽享\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":17,\\\"StockQty\\\":517,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":89.000000,\\\"Price\\\":89.000000,\\\"OrigPrice\\\":159.000000,\\\"GuidePrice\\\":159.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":598617,\\\"ProductBasicSysNo\\\":107747,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"【产地直发】山东蒙阴黄金毛桃9颗(1.6-1.8kg)\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/76ea7867-0df4-4c0d-9603-d27163240393.jpg\\\",\\\"PromotionWord\\\":\\\"\\\",\\\"Status\\\":0,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":239,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-1,\\\"StockQty\\\":-1,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":52.900000,\\\"Price\\\":52.900000,\\\"OrigPrice\\\":88.900000,\\\"GuidePrice\\\":88.900000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":487632,\\\"ProductBasicSysNo\\\":134570,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"【产地直发】阳山水蜜桃12个礼盒装(优级 单果200-250g)\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/d4c783d2-bbea-4f64-8a40-c0a85a05f3f8.jpg\\\",\\\"PromotionWord\\\":\\\"\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":false,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":155,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-12,\\\"StockQty\\\":4988,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":99.000000,\\\"Price\\\":99.000000,\\\"OrigPrice\\\":169.000000,\\\"GuidePrice\\\":169.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":474470,\\\"ProductBasicSysNo\\\":132561,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"豆黄金鲜腐竹117g*4(包) SGS独立慧鉴认证\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/893be947-ee0a-4e99-9bfc-7de2dc1df200.jpg\\\",\\\"PromotionWord\\\":\\\"只用非转基因大豆,和山泉水\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":589,\\\"StockQty\\\":589,\\\"PromotionsTags\\\":[\\\"满赠\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":1,\\\"BasicPrice\\\":68.000000,\\\"Price\\\":49.000000,\\\"OrigPrice\\\":68.000000,\\\"GuidePrice\\\":68.000000,\\\"StartTime\\\":\\\"2021-06-29T00:00:00\\\",\\\"EndTime\\\":\\\"2021-07-26T23:59:59\\\"},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":387408,\\\"ProductBasicSysNo\\\":94578,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"Dole都乐超甜蕉1把(600g以上 4-6根)\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/7484deba-fdce-4b21-9e27-2000ddbd9971.jpg\\\",\\\"PromotionWord\\\":\\\"香甜软糯,甜蜜专享\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":66,\\\"StockQty\\\":66,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":9.900000,\\\"Price\\\":9.900000,\\\"OrigPrice\\\":19.900000,\\\"GuidePrice\\\":19.900000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":373924,\\\"ProductBasicSysNo\\\":91599,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"庞各庄春华园小西瓜 1个/1.5-2kg\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/a7e28490-3b1f-4dc7-9f7d-da3b2b55508f.jpg\\\",\\\"PromotionWord\\\":\\\"皮薄沙瓤味甜,庞各庄西甜瓜\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":false,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":82,\\\"StockQty\\\":82,\\\"PromotionsTags\\\":[\\\"折扣\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":[\\\"/Product/Tag/000f8a67-1845-4a97-a2d4-14a503d115ba.jpg\\\"],\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":29.900000,\\\"Price\\\":29.900000,\\\"OrigPrice\\\":49.000000,\\\"GuidePrice\\\":49.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":494758,\\\"ProductBasicSysNo\\\":136566,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"【预售】新疆蜜糖小红杏1.5kg装\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/29e0e291-dde2-4415-8b6a-7cf571b86c0d.jpg\\\",\\\"PromotionWord\\\":\\\"包邮\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":false,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-133,\\\"StockQty\\\":867,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":89.000000,\\\"Price\\\":89.000000,\\\"OrigPrice\\\":128.000000,\\\"GuidePrice\\\":128.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":337591,\\\"ProductBasicSysNo\\\":71618,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"进口牛油果10个装(单果130克以上)\\\",\\\"ImageUrl\\\":\\\"/ProductImages/000/000/337/591/medium/2ae01620-b32c-4ebb-aa15-90a03de9ed00.jpg\\\",\\\"PromotionWord\\\":\\\"森林奶油 粮食水果\\\",\\\"Status\\\":0,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":-1,\\\"StockQty\\\":-1,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":55.000000,\\\"Price\\\":55.000000,\\\"OrigPrice\\\":99.000000,\\\"GuidePrice\\\":99.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":332717,\\\"ProductBasicSysNo\\\":75101,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"简爱 饮用型酸奶 百香果 风味酸乳 230g\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/a7a05060-1497-4c73-adec-114c1b4a2e73.jpg\\\",\\\"PromotionWord\\\":\\\"百香果遇到原味裸酸奶\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":42,\\\"StockQty\\\":42,\\\"PromotionsTags\\\":[\\\"换购\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":10.800000,\\\"Price\\\":10.800000,\\\"OrigPrice\\\":12.000000,\\\"GuidePrice\\\":12.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":335380,\\\"ProductBasicSysNo\\\":57458,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"卡士 鲜酪乳3.3g乳蛋白风味发酵乳(原味)100g*3\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/bfa68a1d-dfdd-48cf-8c06-ffcb23ba0cc5.jpg\\\",\\\"PromotionWord\\\":\\\"优质奶源 欧洲菌种 营养美味\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":45,\\\"StockQty\\\":45,\\\"PromotionsTags\\\":[\\\"换购\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":14.800000,\\\"Price\\\":14.800000,\\\"OrigPrice\\\":15.800000,\\\"GuidePrice\\\":15.800000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":331565,\\\"ProductBasicSysNo\\\":47904,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"国产金都一号红心火龙果2个装(500g以上)\\\",\\\"ImageUrl\\\":\\\"/ProductImages/000/000/331/565/medium/1780d989-604d-4b52-96f5-f26aef6475fe.jpg\\\",\\\"PromotionWord\\\":\\\"玫红色果肉,娇艳欲滴\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":9,\\\"StockQty\\\":9,\\\"PromotionsTags\\\":[\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":13.900000,\\\"Price\\\":13.900000,\\\"OrigPrice\\\":39.900000,\\\"GuidePrice\\\":39.900000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":363538,\\\"ProductBasicSysNo\\\":71571,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"卡士 餐后一小时风味发酵乳250g*3\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/e6402498-5367-45eb-a690-a14acc8269bf.jpg\\\",\\\"PromotionWord\\\":\\\"\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":18,\\\"StockQty\\\":18,\\\"PromotionsTags\\\":[\\\"换购\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":45.000000,\\\"Price\\\":45.000000,\\\"OrigPrice\\\":48.000000,\\\"GuidePrice\\\":48.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":362219,\\\"ProductBasicSysNo\\\":87347,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"简爱 0%蔗糖 原味发酵乳 135g*4杯\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/cbd4bc8d-704c-41af-950a-b1c1ac2922e7.jpg\\\",\\\"PromotionWord\\\":\\\"新老包装随机发货\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":50,\\\"StockQty\\\":50,\\\"PromotionsTags\\\":[\\\"换购\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":32.800000,\\\"Price\\\":32.800000,\\\"OrigPrice\\\":39.900000,\\\"GuidePrice\\\":39.900000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":283212,\\\"ProductBasicSysNo\\\":62066,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"佳沛新西兰阳光金奇异果 原箱3.3kg(22头)\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/ca785df3-7925-4812-98ac-dbb75801a1a4.jpg\\\",\\\"PromotionWord\\\":\\\"“巨无霸果”--甜蜜爆汁,大口吃到爽,每天一颗活力四射\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":false,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":22,\\\"StockQty\\\":2021,\\\"PromotionsTags\\\":[\\\"返券\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":[\\\"/Product/Tag/133f1667-29c7-4cb6-b6fb-952f818e0db7.png\\\"],\\\"ProductPrice\\\":{\\\"Type\\\":1,\\\"BasicPrice\\\":389.000000,\\\"Price\\\":379.000000,\\\"OrigPrice\\\":399.000000,\\\"GuidePrice\\\":399.000000,\\\"StartTime\\\":\\\"2021-07-06T00:00:00\\\",\\\"EndTime\\\":\\\"2021-07-13T23:59:59\\\"},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":332722,\\\"ProductBasicSysNo\\\":75099,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"简爱 饮用型酸奶 原味 风味酸乳 230g\\\",\\\"ImageUrl\\\":\\\"ProductImages/medium/9b8a6242-e9fa-4579-a5a3-479db5095a6e.jpg\\\",\\\"PromotionWord\\\":\\\"原味裸酸奶 看得见的美味\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":true,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":231,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":40,\\\"StockQty\\\":40,\\\"PromotionsTags\\\":[\\\"换购\\\",\\\"冷链配\\\"],\\\"ActivityTags\\\":,\\\"ProductTag\\\":\\\"\\\",\\\"ProductPrice\\\":{\\\"Type\\\":0,\\\"BasicPrice\\\":10.800000,\\\"Price\\\":10.800000,\\\"OrigPrice\\\":12.000000,\\\"GuidePrice\\\":12.000000},\\\"ReturnPolicy\\\":1},{\\\"ProductSysNo\\\":295944,\\\"ProductBasicSysNo\\\":67825,\\\"WebSiteSysNo\\\":1,\\\"ChannelSysNo\\\":1,\\\"SaleChannelSysNo\\\":1,\\\"ProductName\\\":\\\"百香果20个装(中果900克以上)\\\",\\\"ImageUrl\\\":\\\"ProductImages/000/000/295/944/medium/3a1b68aa-dcf0-4be6-9630-f46bd86bba00.jpg\\\",\\\"PromotionWord\\\":\\\"风味浓郁,芳香怡人\\\",\\\"Status\\\":1,\\\"IsArrivalDay\\\":false,\\\"IsMemberDiscount\\\":true,\\\"CanUseCoupon\\\":false,\\\"StartSaleNumber\\\":1,\\\"ApplyRangeType\\\":-999999,\\\"AreaGroupSysNo\\\":234,\\\"MainStockSysNo\\\":68,\\\"IsEasyHome\\\":false,\\\"StockSalableQty\\\":16,\\\"StockQty\\\":16,\\\"PromotionsTag", :exception=>#<LogStash::Json::ParserError: Unexpected end-of-input in VALUE_STRING
at [Source: (byte[])"{"@local_time":"2021-07-08 16:55:42.612","@log_entry":"benlai://srv.xxx.cn/ProductList/GetList,\ninput-->{\"productSysNoList\":[585990,412486,586316,348552,406201,598617,487632,474470,387408,373924,494758,337591,332717,335380,331565,363538,362219,283212,332722,295944],\"toWebSiteSysNo\":1,\"IncludeInventoryQuantity\":true,\"AreaSysNo\":561,\"trackId\":\"Benlai.Api.WebApi-0ac97e13_1-451592-171604\",\"userIp\":\"221.192.179.52\",\"appId\":3918,\"clientSource\":2};\noutput-->"[truncated 15884 bytes]; line: 1, column: 32769]>}
 
 
logstash 配置如下

input {
  kafka {
    bootstrap_servers => "192.168.112.15:9092,192.168.113.202:9092,192.168.113.203:9092"
    topics => ["k8s-online"]
    group_id => "logger_hot"
    consumer_threads => 16
  }
}

filter {
  mutate {
    gsub => [ "message", "u0026", "&"]
    gsub => [ "message", "u003c", "<"]
    gsub => [ "message", "u003e", ">"]
  }
  json {
    source => "message"  
  }

  if [kubernetes] {
    mutate {
      remove_field => ["message"]
      gsub => [ "log", "u0026", "&"]
    }
  }
  if [kubernetes][namespace_name] !~ "^kube" {
    if [log] =~ "^(2019|2020)" {
      grok {
        match => {
          "log" => "%{TIMESTAMP_ISO8601:datetime} (\[%{NOTSPACE:threadid}\]) (\[%{IP:localip}?\]) %{NOTSPACE:level} %{NOTSPACE:log_type} - %{GREEDYDATA:ms}"
        }
      }
      if [ms] {
        mutate { 
          remove_field => ["message"]
          gsub => [ "ms", "u0026", "&"]
          gsub => [ "log", "u0026", "&"]
        }
        
      }
      if [datetime1] {
        date {
          match => ["datetime","YYYY-MM-dd HH:mm:ss.SSS"]
          timezone => "+08:00"
        }
      }
    } else {
      if [log] =~ '^{"@local_time"' {
        json {
          source => "log"
        }
        date {
          match => ["@local_time","YYYY-MM-dd HH:mm:ss.SSS", "ISO8601"]
          timezone => "+08:00"
        }
        if "_timestampparsefailure" in [tags] {
          mutate {
            remove_field => ["_@timestamp", "@local_time"]
            remove_tag => "_timestampparsefailure"
          }
        }
        
        if [@log_entry] {
          mutate {
            add_field => { "format_type" => "json" }
            gsub => [ "@log_entry", "u0026", "&"]
            gsub => [ "log", "u0026", "&"]
            remove_field => ["log"]
          }
        } else {
          mutate {
            add_field => { "format_type" => "json" }
          }
        }
      }
    }
  }
  if [kubernetes][container_name] == "nginx-ingress-controller" {
    if [log] =~ '^{"'{
      json {
          source => "log"
      }
      mutate {
        add_field => { "ingress_type" => "json" }
        remove_field => ["log", "message"]
        gsub => [ "request_query", "u0026", "&"]
        gsub => [ "http_referrer", "u0026", "&"]
        # convert => {"response" => "integer"}
        convert => {"request_length" => "integer"}
        convert => {"request_time" => "float"}
        convert => {"upstream_response_length" => "integer"}
        convert => {"upstream_response_time" => "float"}
        convert => {"upstream_status" => "integer"}
        convert => {"bytes" => "integer"}
        gsub => [ "@log_entry", "u0026", "&"]
      }

      if [time] {
        date {
          match => ["time","ISO8601"]
          target => "@timestamp"
          timezone => "UTC"
        }
      }

    } else {
      grok {
          match => {
            "log" => '%{IPORHOST:real_ip} - \[%{IPORHOST:real_ip2}\] (%{USER:ident}|-) (%{USER:auth}|-) \[%{HTTPDATE:accept_date}\] "%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:http_version}|-)" %{NUMBER:response} %{NUMBER:bytes:int} "(%{QS:referrer}|-)" %{QS:agent} (%{NUMBER:request_length:int}|-) (%{NUMBER:request_time:float}|-) \[(%{NOTSPACE:upstream_name}|-)\] (%{NOTSPACE:upstream_addr}|-) %{NUMBER:upstream_response_length:int} (%{NUMBER:upstream_response_time:float}|-) (%{NUMBER:upstream_status}|-) (%{NOTSPACE:req_id}|-)'
          }
      }

      mutate {
        add_field => { "ingress_type" => "text" }
        convert => {"response" => "integer"}
        convert => {"request_length" => "integer"}
        convert => {"request_time" => "float"}
        convert => {"upstream_response_length" => "integer"}
        convert => {"upstream_response_time" => "float"}
        convert => {"upstream_status" => "integer"}
        convert => {"bytes" => "integer"}
        gsub => [ "log", "u0026", "&"]
        
      }

      if [real_ip] {
        mutate {
          remove_field => ["log", "message"]
        }
      }

      if [accept_date] {
          date {
            match => ["accept_date","dd/MMM/yyy:HH:mm:ss +0000"]
            timezone => "UTC"
          }
      }
    }
  }
  if "_timestampparsefailure" in [tags] {
    mutate {
      remove_field => "_@timestamp"
      remove_tag => "_timestampparsefailure"
    }
  }
}


output {
  if [kubernetes][container_name] == "nginx-ingress-controller" {
    elasticsearch {
      hosts => [ "192.168.115.25","192.168.115.26","192.168.115.27"]
      index => "k8s_prod_ingress_%{[ingress_type]}_04_%{+YYYY.MM.dd}"
    }

  } else {
    if [format_type] {
      elasticsearch {
        hosts => [ "192.168.115.25","192.168.115.26","192.168.115.27"]
        index => "k8s_prod_%{[kubernetes][namespace_name]}_%{[format_type]}_04_%{+YYYY.MM.dd}"
      }
    } else {
      elasticsearch {
        hosts => [ "192.168.115.25","192.168.115.26","192.168.115.27"]
        index => "k8s_prod_%{[kubernetes][namespace_name]}_04_%{+YYYY.MM.dd}"
      }
    }
  }
}
 
已邀请:

tongchuan1992 - 学无止境、学以致用

赞同来自:

您好,你这个可以看看是不是转码的问题导致的json转换报错,用utf-8发送数据测试一下。

angelo

赞同来自:

1626074242651.jpg

 

sdx

赞同来自:

对的,有限制,太大的会被截断

要回复问题请先登录注册