вот что может дать вам направление (хотя не обязательно слишком производительное / эффективное, в зависимости от размера набора входных данных).
datatable(timestamp:datetime, ip:string, user_agent:string, product_page:string)
[
datetime(2019-01-01 01:00), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 01:01), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 01:00), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-01 01:01), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-01 01:59), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 02:00), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 02:01), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 02:02), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 07:43), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-02 02:01), '1.2.3.4', 'Netscape', 'product 5',
]
| extend user = strcat(ip, "/", user_agent)
| order by user asc, timestamp asc
| extend session_start = row_window_session(timestamp, 24h, 24h, user_agent != prev(user_agent) or product_page != prev(product_page) or ip != prev(ip))
| summarize session_count = dcount(session_start) by user, product_page
->
| user | product_page | session_count |
|------------------|--------------|---------------|
| 1.2.3.4/Netscape | product 5 | 2 |
| 1.2.3.4/Netscape | product 4 | 1 |
| 1.2.3.5/Chrome | product 5 | 1 |
для второго запроса может работать следующее:
datatable(timestamp:datetime, ip:string, user_agent:string, product_page:string)
[
datetime(2019-01-01 01:00), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 01:01), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 01:00), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-01 01:01), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-01 01:59), '1.2.3.4', 'Netscape', 'product 5',
datetime(2019-01-01 02:00), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 02:01), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 02:02), '1.2.3.4', 'Netscape', 'product 4',
datetime(2019-01-01 07:43), '1.2.3.5', 'Chrome', 'product 5',
datetime(2019-01-02 02:01), '1.2.3.4', 'Netscape', 'product 5',
]
| extend user = strcat(ip, "/", user_agent)
| summarize count() by user, startofday(timestamp)
| project-away timestamp
->
| user | count_ |
|------------------|--------|
| 1.2.3.4/Netscape | 6 |
| 1.2.3.5/Chrome | 3 |
| 1.2.3.4/Netscape | 1 |