Analyze sales system logs

更新时间:
复制 MD 格式

Transaction records are a core asset for e-commerce companies, representing the final outcome of marketing and promotional campaigns. By analyzing this data, you can build user profiles to inform marketing strategies and gauge product popularity to optimize inventory.

Transaction information is stored as logs in Log Service. With fast queries and SQL-based analytics, Log Service can process hundreds of millions of logs in seconds. This topic provides several examples of how to extract valuable insights.

A complete transaction record contains product information (name, price), transaction details (final price, payment method, discounts), and buyer information (membership details). The following is a sample bill log:

__source__:  10.164.232.105      __topic__:  bonus_discount:  category:  Men's Clothing    commodity:  Men's Slim-Fit Winter Jeans commodity_id:  443 discount:  member_discount:  member_level:  nomember_point:  memberid:  mobile:  pay_transaction_id:  060f0e0d080e0b05060307010c0f0209010e0e010c0a0605000606050b0c0400 pay_with:  alipay real_price:  52.0 suggest_price:  52.0   

Statistical analysis

To query and analyze your data, you must create indexes.

  • View the sales distribution by product category.

    *|select count(1) as pv ,category group by category limit 100                    

    销售占比

  • Identify top-selling items in the women's clothing category.

    category:  Women's Clothing/Boutique  | select count(1) as deals , commodity 
    group by commodity order by deals  desc limit 20                    

    女装销售

  • Analyze the share and turnover for each payment method.

    *  | select count(1) as deals , pay_with group by pay_with  order by deals  desc limit 20
    *  | select sum(real_price)  as total_money , pay_with group by pay_with  order by total_money  desc limit 20                 

    支付方式饼图支付方式柱状图