building-heka

JSON

rev 12  |  foxhop  |  1409094970000  |  JSON

rev 11
rev 12
122.. code-block:: bash122.. code-block:: bash
123123
n124use_tls = truen124 use_tls = true
125125
t126    [tcp:9612.tls]t126     [tcp:9612.tls]
127    cert_file = "self-signed.crt"127     cert_file = "self-signed.crt"
128    key_file = "self-signed.key"128     key_file = "self-signed.key"
129129
130Notice that we are skipping crt verification which is susceptible to man-in-the-130Notice that we are skipping crt verification which is susceptible to man-in-the-
>middle-attacks.  Also we are not using client verification.  Heka supports both.>middle-attacks.  Also we are not using client verification.  Heka supports both.
> > 
rev 11  |  foxhop  |  1409094946000  |  JSON

rev 10
rev 11
8686
8787
nn88heka and ssl
89==================
8890
tt91heka supports SSL, for testing I used self signed certs, it looked something lik
 >e this:
92 
93edit openssl.conf and add the following entry to the **[ v3_ca ]** substituting 
 >the IP address as needed:
94 
95 
96 
97.. code-block:: bash
98 
99 sudo vim /etc/ssl/openssl.cnf
100 
101.. code-block:: bash
102 
103 subjectAltName = IP:192.168.1.62
104 
105Produce self-signed crt and key:
106 
107.. code-block:: bash
108 
109 sudo openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout self-signed.key -
 >out self-signed.crt
110 
111On the outbound TCP hekad "client" configuration I added the following:
112 
113.. code-block:: bash
114 
115 use_tls = true
116 
117     [tcp:9612.tls]
118     insecure_skip_verify = true
119 
120On the inbound TCP hekad "server" configuration I added the following:
121 
122.. code-block:: bash
123 
124use_tls = true
125 
126    [tcp:9612.tls]
127    cert_file = "self-signed.crt"
128    key_file = "self-signed.key"
129 
130Notice that we are skipping crt verification which is susceptible to man-in-the-
 >middle-attacks.  Also we are not using client verification.  Heka supports both.
 > 
89 131 
rev 10  |  foxhop  |  1396346084000  |  JSON

rev 9
rev 10
t1Heka build environmentt1Hacking on heka log router
2############################2############################
33
rev 9  |  foxhop  |  1396346034000  |  JSON

rev 8
rev 9
23 source build.sh23 source build.sh
2424
n25how to run testsn25 
26Test heka
26=====================27=====================
2728
46 # ctest -R [desired-test]47 # ctest -R [desired-test]
47 ctest -R tcp48 ctest -R tcp
tt49 
50 
4851
4952
rev 8  |  foxhop  |  1396345999000  |  JSON

rev 7
rev 8
23 source build.sh23 source build.sh
2424
nn25how to run tests
26=====================
27 
28So first you need to make sure you have all the dependencies needed to build hek
 >a, the best way to find out is to `Build heka`_.
29 
30If that works, make heka/build your current working directory and run either:
31 
32.. code-block:: bash
33 
34 make test
35 
36or:
37 
38.. code-block:: bash
39 
40 ctest
41 
42to test only the code you are changing run:h
43 
44.. code-block:: bash
45 
46 # ctest -R [desired-test]
47 ctest -R tcp
48 
49 
25how I resolved regexp default delimiter defect50how I resolved regexp default delimiter defect
n26--------------------------------------------------------n51======================================================
2752
28This patch resolves a defect that causes the regexp default53This patch resolves a defect that causes the regexp default
5883
5984
n60how to run testsn
61=====================
6285
t63So first you need to make sure you have all the dependencies needed to build hekt
>a, the best way to find out is to `Build heka`_. 
64 
65If that works, make heka/build your current working directory and run either:
66 
67.. code-block:: bash
68 
69 make test
70 
71or:
72 
73.. code-block:: bash
74 
75 ctest
76 
77to test only the code you are changing run:h
78 
79.. code-block:: bash
80 
81 # ctest -R [desired-test]
82 ctest -R tcp
83 86 
rev 7  |  foxhop  |  1396345951000  |  JSON

rev 6
rev 7
63So first you need to make sure you have all the dependencies needed to build hek63So first you need to make sure you have all the dependencies needed to build hek
>a, the best way to find out is to `Build heka`_.>a, the best way to find out is to `Build heka`_.
6464
n65If that works, make heka/build your current working directory and run eithern65If that works, make heka/build your current working directory and run either:
6666
67.. code-block:: bash67.. code-block:: bash
69 make test69 make test
7070
n71orn71or:
7272
73.. code-block:: bash73.. code-block:: bash
75 ctest75 ctest
7676
n77to test only the code you are changing runn77to test only the code you are changing run:h
7878
79.. code-block:: bash79.. code-block:: bash
8080
t81 ctest -R [desired-test]t81 # ctest -R [desired-test]
82  82 ctest -R tcp
83 
rev 6  |  foxhop  |  1396345838000  |  JSON

rev 5
rev 6
63So first you need to make sure you have all the dependencies needed to build hek63So first you need to make sure you have all the dependencies needed to build hek
>a, the best way to find out is to `Build heka`_.>a, the best way to find out is to `Build heka`_.
6464
n65If that works, make heka/build your current working directory and run either::n65If that works, make heka/build your current working directory and run either
66 
67.. code-block:: bash
6668
67 make test69 make test
6870
n69or::n71or
72 
73.. code-block:: bash
7074
71 ctest75 ctest
7276
t73to test only the code you are changing run::t77to test only the code you are changing run
78 
79.. code-block:: bash
7480
75 ctest -R [desired-test]81 ctest -R [desired-test]
rev 5  |  foxhop  |  1396345774000  |  JSON

rev 4
rev 5
5656
57Ok, I learned from reviewing TravisCI output that I needed `sudo apt-get install57Ok, I learned from reviewing TravisCI output that I needed `sudo apt-get install
> protobuf-compiler` in order to run `go test`. > protobuf-compiler` in order to run `go test`. 
tt58 
59 
60how to run tests
61=====================
62 
63So first you need to make sure you have all the dependencies needed to build hek
 >a, the best way to find out is to `Build heka`_.
64 
65If that works, make heka/build your current working directory and run either::
66 
67 make test
68 
69or::
70 
71 ctest
72 
73to test only the code you are changing run::
74 
75 ctest -R [desired-test]
76  
rev 4  |  foxhop  |  1395879853000  |  JSON

rev 3
rev 4
2222
23 source build.sh23 source build.sh
tt24 
25how I resolved regexp default delimiter defect
26--------------------------------------------------------
27 
28This patch resolves a defect that causes the regexp default
29config delimiter to always be clobbered, now we check before we step.
30 
31        `modified:   plugins/tcp/tcp_input.go`
32 
33 
34Here is the manual test case:
35 
36.. code-block:: toml
37 
38    [TcpInput]
39    address = "127.0.0.1:5565"
40    parser_type = "regexp"
41 
42    [STDOUT]
43    type = "LogOutput"
44    message_matcher = "TRUE"
45    payload_only = true
46 
47and I used netcat to test:
48 
49 
50.. code-block:: bash
51 
52    nc 127.0.0.1 5565
53    hello, heka!
54 
55I tried to run the unit tests in the code base with `go test` but I got errors a
 >bout missing libraries ...
56 
57Ok, I learned from reviewing TravisCI output that I needed `sudo apt-get install
 > protobuf-compiler` in order to run `go test`. 
rev 3  |  foxhop  |  1395876984000  |  JSON

rev 2
rev 3
10 sudo tar -C /usr/local -xzf go1.2.1.linux-amd64.tar.gz10 sudo tar -C /usr/local -xzf go1.2.1.linux-amd64.tar.gz
1111
t12 export PATH=$PATH:/usr/local/go/bint12 # this is a hack, use soft links or install in the proper location the first ti
 >me
13 sudo mv /usr/local/go/* /usr/bin
14 
1315
1416
rev 2  |  foxhop  |  1395876526000  |  JSON

rev 1
rev 2
f1Heka build environmentf1Heka build environment
2############################2############################
nn3 
4download and install go
35
4.. code-block:: bash6.. code-block:: bash
1113
1214
tt15 
13Build heka16Build heka
14==============17==============
rev 1  |  foxhop  |  1395876470000  |  JSON

empty
rev 1
tt1Heka build environment
2############################
3 
4.. code-block:: bash
5 
6 wget http://go.googlecode.com/files/go1.2.1.linux-amd64.tar.gz
7 
8 sudo tar -C /usr/local -xzf go1.2.1.linux-amd64.tar.gz
9 
10 export PATH=$PATH:/usr/local/go/bin
11 
12 
13Build heka
14==============
15 
16.. code-block:: bash
17 
18 source build.sh