-
Notifications
You must be signed in to change notification settings - Fork 7
/
ex1.pig
119 lines (117 loc) · 2.13 KB
/
ex1.pig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
-- Count the number of TCP connections per each client IP.
A = LOAD 'tstat-sample.txt' using PigStorage(' ') AS (ip_c:chararray,
port_c:int,
packets_c:int,
rst_c:int,
ack_c:int,
purack_c:int,
unique_bytes_c:long,
data_pkts_c:int,
data_bytes_c:long,
rexmit_pkts_c:int,
rexmit_bytes_c:long,
out_seq_pkts_c:int,
syn_c:int,
fin_c:int,
ws_c:int,
ts_c:int,
window_scale_c:int,
sack_req_c:int,
sack_sent_c:int,
mss_c:int,
max_seg_size_c:int,
min_seg_size_c:int,
win_max_c:int,
win_min_c:int,
win_zero_c:int,
cwin_max_c:long,
cwin_min_c:long,
initial_cwin_c:long,
average_rtt_c:double,
rtt_min_c:double,
rtt_max_c:double,
stdev_rtt_c:double,
rtt_count_c:int,
ttl_min_c:int,
ttl_max_c:int,
rtx_RTO_c:int,
rtx_FR_c:int,
reordering_c:int,
net_dup_c:int,
unknown_segments_c:int,
flow_control_c:int,
unnece_rtx_rto_c:int,
unnece_rtx_fr_c:int,
different_syn_seqno_c:int,
ip_s:chararray,
port_s:int,
packets_s:int,
rst_s:int,
ack_s:int,
purack_s:int,
unique_bytes_s:long,
data_pkts_s:int,
data_bytes_s:long,
rexmit_pkts_s:int,
rexmit_bytes_s:long,
out_seq_pkts_s:int,
syn_s:int,
fin_s:int,
ws_s:int,
ts_s:int,
window_scale_s:int,
sack_req_s:int,
sack_sent_s:int,
mss_s:int,
max_seg_size_s:int,
min_seg_size_s:int,
win_max_s:int,
win_min_s:int,
win_zero_s:int,
cwin_max_s:long,
cwin_min_s:long,
initial_cwin_s:long,
average_rtt_s:double,
rtt_min_s:double,
rtt_max_s:double,
stdev_rtt_s:double,
rtt_count_s:int,
ttl_min_s:int,
ttl_max_s:int,
rtx_RTO_s:int,
rtx_FR_s:int,
reordering_s:int,
net_dup_s:int,
unknown_segments_s:int,
flow_control_s:int,
unnece_rtx_rto_s:int,
unnece_rtx_fr_s:int,
different_syn_seqno_s:int,
completion_time:double,
first_time:double,
last_time:double,
C_first_payload:double,
S_first_payload:double,
C_last_payload:double,
S_last_payload:double,
C_first_ack:double,
S_first_ack:double,
first_time_abs:double,
c_internal:int,
s_internal:int,
connection_type:int,
p2p_type:int,
p2p_subtype:int,
ed2k_data:int,
ed2k_signaling:int,
ed2k_c2s:int,
ed2k_c2c:int,
ed2k_chat:int,
http_type:int,
ssl_client_hello:chararray,
ssl_server_hello:chararray,
dropbox_id:bytearray,
fqdn:chararray);
B = GROUP A BY ip_c;
C = FOREACH B GENERATE group, COUNT(A);
STORE C INTO 'output/ex1';