summaryrefslogtreecommitdiffstats
path: root/test/test_json_format.sh
blob: 038738755d9aeac35dd1306e0e19b0b235955dfa (plain)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#! /bin/bash

export YES_COLOR=1

# journald json log format is not working"
run_cap_test env TZ=UTC ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_journald.json

# json log format is not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_json.json

# json log format is not working"
run_cap_test ${lnav_test} -n -I ${test_dir} \
    -c ':switch-to-view pretty' \
    -c ':switch-to-view log' \
    -c ':switch-to-view pretty' \
    ${test_dir}/logfile_json.json

# multi-line-format json log format is not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/log.clog

# log levels not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select * from test_log' \
    -c ':write-csv-to -' \
    ${test_dir}/logfile_json.json

# log levels not working" < ${test_dir}/logfile_jso
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select log_raw_text from test_log' \
    -c ':write-raw-to -' \
    ${test_dir}/logfile_json.json

# write-raw-to with json is not working" <
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ':goto 0' \
    -c ':mark' \
    -c ':goto 1' \
    -c ':mark' \
    -c ':goto 2' \
    -c ':mark' \
    -c ':write-raw-to -' \
    ${test_dir}/log.clog

# json output not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select * from test_log' \
    -c ':write-json-to -' \
    ${test_dir}/logfile_json.json

# timestamp-format not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_json2.json

# log levels not working"
run_cap_test ${lnav_test} -n -d /tmp/lnav.err \
    -I ${test_dir} \
    -c ';select * from json_log2' \
    -c ':write-csv-to -' \
    ${test_dir}/logfile_json2.json

# pipe-line-to is not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ":goto 4" \
    -c ":pipe-line-to sed -e 's/2013//g'" \
    -c ":switch-to-view text" \
    ${test_dir}/logfile_json.json

# json log format is not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_nested_json.json

# log levels not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select * from ntest_log' \
    -c ':write-csv-to -' \
    ${test_dir}/logfile_nested_json.json

# pipe-line-to is not working"
run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    -c ":goto 4" \
    -c ":pipe-line-to sed -e 's/2013//g'" \
    -c ":switch-to-view text" \
    ${test_dir}/logfile_nested_json.json

# json log3 format is not working"
run_cap_test env TZ=UTC ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_json3.json

# json log3 format is not working"
run_cap_test env TZ=UTC ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select * from json_log3' \
    -c ':write-csv-to -' \
    ${test_dir}/logfile_json3.json

run_cap_test env TZ=America/New_York ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_json3.json

# json log3 format is not working"
run_cap_test env TZ=America/New_York ${lnav_test} -n \
    -I ${test_dir} \
    -c ';select * from json_log3' \
    -c ':write-csv-to -' \
    ${test_dir}/logfile_json3.json

# json log format is not working"
run_cap_test ${lnav_test} -n \
    -d /tmp/lnav.err \
    -I ${test_dir} \
    ${test_dir}/logfile_invalid_json.json

# json log format is not working"
run_cap_test ${lnav_test} -n \
    -d /tmp/lnav.err \
    -I ${test_dir} \
    ${test_dir}/logfile_invalid_json2.json

run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_mixed_json2.json

run_cap_test ${lnav_test} -n \
    -I ${test_dir} \
    ${test_dir}/logfile_json_subsec.json