├── .gitignore ├── LICENSE ├── README.md ├── average └── Average.go ├── count └── Count.go ├── example ├── large_simple_test ├── test1 ├── test2 ├── test3 └── test4 ├── expr └── Expr.go ├── filter └── Filter.go ├── graph └── Graph.go ├── group └── Grouper.go ├── parse └── Parse.go ├── release.sh ├── render-util └── RenderUtil.go ├── render └── Render.go ├── search └── Main.go ├── ss └── Main.go ├── sum └── Sum.go ├── sumo └── Main.go └── util └── Raw.go /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | .idea 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2015 SumoLogic 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archived! 2 | We have chosen to archive sumoshell as we can not continue to support its growth. The original author has created a spiritual successor called [angle-grinder](https://github.com/rcoh/angle-grinder) and we recommend you investigate that. 3 | 4 | # sumoshell 5 | [![Join the chat at https://gitter.im/SumoLogic/sumoshell](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/SumoLogic/sumoshell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | `Sumoshell` is collection of utilities to improve analyzing log files written in Go. `grep` can't tell that some log lines span multiple individual lines. Parsing out fields is cumbersome. Aggregating is basically impossible, and there is no good way to view the results. In Sumoshell, each individual command acts as a phase in a pipeline to get the answer you want. Sumoshell brings a lot of the functionality of [Sumo Logic](https://www.sumologic.com) to the command line. 8 | 9 | Commands should start with 10 | `sumo search [filter]` which will transform logs into the json format `sumoshell` uses. Commands should end with `render` or `graph` which render the output to the terminal. Each operator is a stand-alone binary allowing them to be easily composed. 11 | 12 | ## Installation 13 | [OSX and Linux binaries are provided for sumoshell](https://github.com/SumoLogic/sumoshell/releases). Simply extract the archive and place the binaries on your path. 14 | 15 | If you run a different OS or would prefer to install from source, it's easy to build from source. Given a working [go](https://golang.org/doc/install) installation, run: 16 | ``` 17 | go get github.com/SumoLogic/sumoshell 18 | cd $GOPATH/src/github.com/SumoLogic/sumoshell # Will warn about `no buildable go source` 19 | go get ./... 20 | go install ./... 21 | ``` 22 | 23 | ## Usage 24 | Like [SumoLogic](https://www.sumologic.com), sumoshell enables you pass log data through a series of transformations to get your final result. Pipelines start with a source (`tail`, `cat`, etc.) followed by the `sumo` operator. An example pipeline might be: 25 | 26 | ```tail -f logfile | sumo search "ERROR" | sumo parse "thread=*]" | sumo count thread | render``` 27 | 28 | This would produce a count of log messages matching `ERROR` by thead. In the basic renderer, the output would look like: 29 | ``` 30 | _Id _count thread 31 | 0 4 C 32 | 1 4 A 33 | 2 1 B 34 | ``` 35 | ### The `sumo search` operator 36 | `sumo search` takes an optional filter parameter to allow for basic searching. The sumo operator performs 3 steps: 37 | 38 | 1. Break a text file into logical log messages. This merges things like stack traces into a single message for easy searching. 39 | 2. Allow basic searching. 40 | 3. Transforms the log message into the sumoshell internal json format. 41 | 42 | ### The `sumo json` operator 43 | For JSON logging, the `sumo json` operator will automatically parse JSON from your logs and extract key value pairs. 44 | 45 | ### Displaying results 46 | 47 | After using the `sumo` operator, the output will be in JSON. To re-render the output in a human-readable form, `|` the results of your query into one of the three `render` operators. 48 | 49 | 1. `render`: Capable of rendering aggregate and non-aggregate data. 50 | 51 | * Add `nowraw` to drop the raw data when an aggregate isn't present. 52 | * Aggregates are updated in place using terminal escape sequences, with a limit of 20 shown. Add `all` to remove the limit. Aggregates will be rendered when the stream ends (ctrl+c) 53 | 54 | 2. `graph`: Curses based renderer for rendering tabular data as a bar chart. 55 | 56 | 57 | ### Parsing Data 58 | 59 | sumoshell supports a basic parse operator similar to the `parse` operator in `SumoLogic`. Queries take the form: 60 | ``` 61 | ... | sumo parse "[pattern=*] pattern2:'*' morePatterns=(*)" as pattern, pattern2, more | ... 62 | ``` 63 | 64 | ### Filtering Data 65 | 66 | sumoshell supports a filter operator similar to the `where` operator in `SumoLogic`. Queries take the form: 67 | ``` 68 | ... | sumo parse "[host=*]" as host | sumo filter host = server1 69 | ``` 70 | 71 | This will drop any log lines that don't have `server1` as the host. 72 | 73 | ### Aggregating Data 74 | 75 | sumoshell currently supports 3 aggregate operators: 76 | 77 | 1. `count` Example queries: 78 | ``` 79 | ... | sumo count # number of rows 80 | ... | sumo count key # number of rows per key 81 | ... | sumo count key value # number of rows per the cartesian product of (key, value) 82 | 83 | ``` 84 | 85 | 2. `sum` Example queries: 86 | ``` 87 | ... | sumo sum k # sum of all k's 88 | ... | sumo sum v by k # sum of all v's by k 89 | 90 | ``` 91 | 92 | 3. `average` Example queries: 93 | ``` 94 | ... | sumo average k # average of all k's 95 | ... | sumo average v by k # average of all v's by k 96 | 97 | ``` 98 | -------------------------------------------------------------------------------- /average/Average.go: -------------------------------------------------------------------------------- 1 | package average 2 | 3 | import ( 4 | "fmt" 5 | "github.com/SumoLogic/sumoshell/group" 6 | "github.com/SumoLogic/sumoshell/util" 7 | "strconv" 8 | "sync" 9 | ) 10 | 11 | const Avg = "_avg" 12 | 13 | type average struct { 14 | samples *int 15 | sum *float64 16 | key string 17 | // DO NOT MODIFY BASE 18 | base map[string]interface{} 19 | mu *sync.Mutex 20 | output func(map[string]interface{}) 21 | } 22 | 23 | func makeAverage(key string) average { 24 | samp := 0 25 | v := 0.0 26 | mu := sync.Mutex{} 27 | return average{&samp, &v, key, make(map[string]interface{}), &mu, util.NewJsonWriter().Write} 28 | } 29 | 30 | func aggregateAverage(output grouper.Merger, key string, base map[string]interface{}) util.SumoAggOperator { 31 | samp := 0 32 | v := 0.0 33 | mu := sync.Mutex{} 34 | return average{&samp, &v, key, base, &mu, output.Write} 35 | } 36 | 37 | func Build(args []string) (util.SumoAggOperator, error) { 38 | args = args[1:] 39 | 40 | if len(args) == 1 { 41 | return makeAverage(args[0]), nil 42 | } else if len(args) > 1 { 43 | key := args[0] 44 | //_ := args[1] 45 | keyFields := args[2:] 46 | return grouper.NewAggregate(aggregateAverage, keyFields, key, Avg), nil 47 | } else { 48 | return nil, util.ParseError("Need a argument to average (`avg keyname`)") 49 | } 50 | } 51 | 52 | func (avg average) Flush() { 53 | avg.mu.Lock() 54 | defer avg.mu.Unlock() 55 | if *avg.samples > 0 { 56 | avg.output(util.CreateStartRelation()) 57 | avg.output(util.CreateRelation(currentState(avg))) 58 | avg.output(util.CreateEndRelation()) 59 | } 60 | } 61 | 62 | func currentState(a average) map[string]interface{} { 63 | ret := make(map[string]interface{}) 64 | for key, val := range a.base { 65 | ret[key] = val 66 | } 67 | ret[Avg] = *a.sum / float64(*a.samples) 68 | return ret 69 | } 70 | 71 | func (a average) Process(inp map[string]interface{}) { 72 | a.mu.Lock() 73 | defer a.mu.Unlock() 74 | if util.IsPlus(inp) || util.IsRelation(inp) { 75 | v, keyInMap := inp[a.key] 76 | if keyInMap { 77 | f, keyIsNumber := strconv.ParseFloat(fmt.Sprint(v), 64) 78 | if keyIsNumber == nil { 79 | *a.samples += 1 80 | *a.sum += f 81 | } 82 | } 83 | } else if util.IsStartRelation(inp) { 84 | *a.samples = 0 85 | *a.sum = 0 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /count/Count.go: -------------------------------------------------------------------------------- 1 | package count 2 | 3 | import ( 4 | "github.com/SumoLogic/sumoshell/group" 5 | "github.com/SumoLogic/sumoshell/util" 6 | "sync" 7 | ) 8 | 9 | const Count = "_count" 10 | 11 | type count struct { 12 | ct *int 13 | base map[string]interface{} 14 | output func(map[string]interface{}) 15 | mu *sync.Mutex 16 | } 17 | 18 | func makeCount() count { 19 | ct := 0 20 | return count{&ct, make(map[string]interface{}), util.NewJsonWriter().Write, &sync.Mutex{}} 21 | } 22 | 23 | func aggregateCount(output grouper.Merger, key string, base map[string]interface{}) util.SumoAggOperator { 24 | ct := 0 25 | count := count{&ct, base, output.Write, &sync.Mutex{}} 26 | return count 27 | } 28 | 29 | func Build(args []string) (util.SumoAggOperator, error) { 30 | args = args[1:] 31 | if len(args) == 0 { 32 | return makeCount(), nil 33 | } else { 34 | keyFields := args 35 | // key is meaningless for count 36 | return grouper.NewAggregate(aggregateCount, keyFields, "", Count), nil 37 | } 38 | } 39 | 40 | func (ct count) Flush() { 41 | ct.mu.Lock() 42 | defer ct.mu.Unlock() 43 | ct.output(util.CreateStartRelation()) 44 | ct.output(util.CreateRelation(currentState(ct))) 45 | ct.output(util.CreateEndRelation()) 46 | } 47 | 48 | func currentState(ct count) map[string]interface{} { 49 | ret := make(map[string]interface{}) 50 | for key, val := range ct.base { 51 | ret[key] = val 52 | } 53 | ret[Count] = *ct.ct 54 | return ret 55 | } 56 | 57 | func (ct count) Process(inp map[string]interface{}) { 58 | ct.mu.Lock() 59 | defer ct.mu.Unlock() 60 | if util.IsStartRelation(inp) { 61 | *ct.ct = 0 62 | } else if util.IsEndRelation(inp) { 63 | //ct.Flush() 64 | } else if util.IsPlus(inp) || util.IsRelation(inp) { 65 | *ct.ct += 1 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /example/large_simple_test: -------------------------------------------------------------------------------- 1 | [a=1][b=a] 2 | [a=1][b=a] 3 | [a=2][b=a] 4 | [a=3][b=a] 5 | [a=4][b=a] 6 | [a=4][b=a] 7 | [a=4][b=a] 8 | [a=4][b=b] 9 | [a=3][b=b] 10 | [a=3][b=b] 11 | [a=3][b=b] 12 | [a=4][b=b] 13 | [a=4][b=b] 14 | [a=5][b=b] 15 | 16 | [a=1][b=a] 17 | [a=1][b=a] 18 | [a=2][b=a] 19 | [a=3][b=a] 20 | [a=4][b=a] 21 | [a=4][b=a] 22 | [a=4][b=a] 23 | [a=4][b=b] 24 | [a=3][b=b] 25 | [a=3][b=b] 26 | [a=3][b=b] 27 | [a=4][b=b] 28 | [a=4][b=b] 29 | [a=5][b=b] 30 | 31 | [a=1][b=a] 32 | [a=1][b=a] 33 | [a=2][b=a] 34 | [a=3][b=a] 35 | [a=4][b=a] 36 | [a=4][b=a] 37 | [a=4][b=a] 38 | [a=4][b=b] 39 | [a=3][b=b] 40 | [a=3][b=b] 41 | [a=3][b=b] 42 | [a=4][b=b] 43 | [a=4][b=b] 44 | [a=5][b=b] 45 | 46 | [a=1][b=a] 47 | [a=1][b=a] 48 | [a=2][b=a] 49 | [a=3][b=a] 50 | [a=4][b=a] 51 | [a=4][b=a] 52 | [a=4][b=a] 53 | [a=4][b=b] 54 | [a=3][b=b] 55 | [a=3][b=b] 56 | [a=3][b=b] 57 | [a=4][b=b] 58 | [a=4][b=b] 59 | [a=5][b=b] 60 | 61 | [a=1][b=a] 62 | [a=1][b=a] 63 | [a=2][b=a] 64 | [a=3][b=a] 65 | [a=4][b=a] 66 | [a=4][b=a] 67 | [a=4][b=a] 68 | [a=4][b=b] 69 | [a=3][b=b] 70 | [a=3][b=b] 71 | [a=3][b=b] 72 | [a=4][b=b] 73 | [a=4][b=b] 74 | [a=5][b=b] 75 | 76 | [a=1][b=a] 77 | [a=1][b=a] 78 | [a=2][b=a] 79 | [a=3][b=a] 80 | [a=4][b=a] 81 | [a=4][b=a] 82 | [a=4][b=a] 83 | [a=4][b=b] 84 | [a=3][b=b] 85 | [a=3][b=b] 86 | [a=3][b=b] 87 | [a=4][b=b] 88 | [a=4][b=b] 89 | [a=5][b=b] 90 | 91 | [a=1][b=a] 92 | [a=1][b=a] 93 | [a=2][b=a] 94 | [a=3][b=a] 95 | [a=4][b=a] 96 | [a=4][b=a] 97 | [a=4][b=a] 98 | [a=4][b=b] 99 | [a=3][b=b] 100 | [a=3][b=b] 101 | [a=3][b=b] 102 | [a=4][b=b] 103 | [a=4][b=b] 104 | [a=5][b=b] 105 | 106 | [a=1][b=a] 107 | [a=1][b=a] 108 | [a=2][b=a] 109 | [a=3][b=a] 110 | [a=4][b=a] 111 | [a=4][b=a] 112 | [a=4][b=a] 113 | [a=4][b=b] 114 | [a=3][b=b] 115 | [a=3][b=b] 116 | [a=3][b=b] 117 | [a=4][b=b] 118 | [a=4][b=b] 119 | [a=5][b=b] 120 | 121 | [a=1][b=a] 122 | [a=1][b=a] 123 | [a=2][b=a] 124 | [a=3][b=a] 125 | [a=4][b=a] 126 | [a=4][b=a] 127 | [a=4][b=a] 128 | [a=4][b=b] 129 | [a=3][b=b] 130 | [a=3][b=b] 131 | [a=3][b=b] 132 | [a=4][b=b] 133 | [a=4][b=b] 134 | [a=5][b=b] 135 | 136 | [a=1][b=a] 137 | [a=1][b=a] 138 | [a=2][b=a] 139 | [a=3][b=a] 140 | [a=4][b=a] 141 | [a=4][b=a] 142 | [a=4][b=a] 143 | [a=4][b=b] 144 | [a=3][b=b] 145 | [a=3][b=b] 146 | [a=3][b=b] 147 | [a=4][b=b] 148 | [a=4][b=b] 149 | [a=5][b=b] 150 | 151 | [a=1][b=a] 152 | [a=1][b=a] 153 | [a=2][b=a] 154 | [a=3][b=a] 155 | [a=4][b=a] 156 | [a=4][b=a] 157 | [a=4][b=a] 158 | [a=4][b=b] 159 | [a=3][b=b] 160 | [a=3][b=b] 161 | [a=3][b=b] 162 | [a=4][b=b] 163 | [a=4][b=b] 164 | [a=5][b=b] 165 | 166 | [a=1][b=a] 167 | [a=1][b=a] 168 | [a=2][b=a] 169 | [a=3][b=a] 170 | [a=4][b=a] 171 | [a=4][b=a] 172 | [a=4][b=a] 173 | [a=4][b=b] 174 | [a=3][b=b] 175 | [a=3][b=b] 176 | [a=3][b=b] 177 | [a=4][b=b] 178 | [a=4][b=b] 179 | [a=5][b=b] 180 | 181 | [a=1][b=a] 182 | [a=1][b=a] 183 | [a=2][b=a] 184 | [a=3][b=a] 185 | [a=4][b=a] 186 | [a=4][b=a] 187 | [a=4][b=a] 188 | [a=4][b=b] 189 | [a=3][b=b] 190 | [a=3][b=b] 191 | [a=3][b=b] 192 | [a=4][b=b] 193 | [a=4][b=b] 194 | [a=5][b=b] 195 | 196 | [a=1][b=a] 197 | [a=1][b=a] 198 | [a=2][b=a] 199 | [a=3][b=a] 200 | [a=4][b=a] 201 | [a=4][b=a] 202 | [a=4][b=a] 203 | [a=4][b=b] 204 | [a=3][b=b] 205 | [a=3][b=b] 206 | [a=3][b=b] 207 | [a=4][b=b] 208 | [a=4][b=b] 209 | [a=5][b=b] 210 | 211 | [a=1][b=a] 212 | [a=1][b=a] 213 | [a=2][b=a] 214 | [a=3][b=a] 215 | [a=4][b=a] 216 | [a=4][b=a] 217 | [a=4][b=a] 218 | [a=4][b=b] 219 | [a=3][b=b] 220 | [a=3][b=b] 221 | [a=3][b=b] 222 | [a=4][b=b] 223 | [a=4][b=b] 224 | [a=5][b=b] 225 | 226 | [a=1][b=a] 227 | [a=1][b=a] 228 | [a=2][b=a] 229 | [a=3][b=a] 230 | [a=4][b=a] 231 | [a=4][b=a] 232 | [a=4][b=a] 233 | [a=4][b=b] 234 | [a=3][b=b] 235 | [a=3][b=b] 236 | [a=3][b=b] 237 | [a=4][b=b] 238 | [a=4][b=b] 239 | [a=5][b=b] 240 | 241 | [a=1][b=a] 242 | [a=1][b=a] 243 | [a=2][b=a] 244 | [a=3][b=a] 245 | [a=4][b=a] 246 | [a=4][b=a] 247 | [a=4][b=a] 248 | [a=4][b=b] 249 | [a=3][b=b] 250 | [a=3][b=b] 251 | [a=3][b=b] 252 | [a=4][b=b] 253 | [a=4][b=b] 254 | [a=5][b=b] 255 | 256 | [a=1][b=a] 257 | [a=1][b=a] 258 | [a=2][b=a] 259 | [a=3][b=a] 260 | [a=4][b=a] 261 | [a=4][b=a] 262 | [a=4][b=a] 263 | [a=4][b=b] 264 | [a=3][b=b] 265 | [a=3][b=b] 266 | [a=3][b=b] 267 | [a=4][b=b] 268 | [a=4][b=b] 269 | [a=5][b=b] 270 | 271 | [a=1][b=a] 272 | [a=1][b=a] 273 | [a=2][b=a] 274 | [a=3][b=a] 275 | [a=4][b=a] 276 | [a=4][b=a] 277 | [a=4][b=a] 278 | [a=4][b=b] 279 | [a=3][b=b] 280 | [a=3][b=b] 281 | [a=3][b=b] 282 | [a=4][b=b] 283 | [a=4][b=b] 284 | [a=5][b=b] 285 | 286 | [a=1][b=a] 287 | [a=1][b=a] 288 | [a=2][b=a] 289 | [a=3][b=a] 290 | [a=4][b=a] 291 | [a=4][b=a] 292 | [a=4][b=a] 293 | [a=4][b=b] 294 | [a=3][b=b] 295 | [a=3][b=b] 296 | [a=3][b=b] 297 | [a=4][b=b] 298 | [a=4][b=b] 299 | [a=5][b=b] 300 | 301 | [a=1][b=a] 302 | [a=1][b=a] 303 | [a=2][b=a] 304 | [a=3][b=a] 305 | [a=4][b=a] 306 | [a=4][b=a] 307 | [a=4][b=a] 308 | [a=4][b=b] 309 | [a=3][b=b] 310 | [a=3][b=b] 311 | [a=3][b=b] 312 | [a=4][b=b] 313 | [a=4][b=b] 314 | [a=5][b=b] 315 | 316 | [a=1][b=a] 317 | [a=1][b=a] 318 | [a=2][b=a] 319 | [a=3][b=a] 320 | [a=4][b=a] 321 | [a=4][b=a] 322 | [a=4][b=a] 323 | [a=4][b=b] 324 | [a=3][b=b] 325 | [a=3][b=b] 326 | [a=3][b=b] 327 | [a=4][b=b] 328 | [a=4][b=b] 329 | [a=5][b=b] 330 | 331 | [a=1][b=a] 332 | [a=1][b=a] 333 | [a=2][b=a] 334 | [a=3][b=a] 335 | [a=4][b=a] 336 | [a=4][b=a] 337 | [a=4][b=a] 338 | [a=4][b=b] 339 | [a=3][b=b] 340 | [a=3][b=b] 341 | [a=3][b=b] 342 | [a=4][b=b] 343 | [a=4][b=b] 344 | [a=5][b=b] 345 | 346 | [a=1][b=a] 347 | [a=1][b=a] 348 | [a=2][b=a] 349 | [a=3][b=a] 350 | [a=4][b=a] 351 | [a=4][b=a] 352 | [a=4][b=a] 353 | [a=4][b=b] 354 | [a=3][b=b] 355 | [a=3][b=b] 356 | [a=3][b=b] 357 | [a=4][b=b] 358 | [a=4][b=b] 359 | [a=5][b=b] 360 | 361 | [a=1][b=a] 362 | [a=1][b=a] 363 | [a=2][b=a] 364 | [a=3][b=a] 365 | [a=4][b=a] 366 | [a=4][b=a] 367 | [a=4][b=a] 368 | [a=4][b=b] 369 | [a=3][b=b] 370 | [a=3][b=b] 371 | [a=3][b=b] 372 | [a=4][b=b] 373 | [a=4][b=b] 374 | [a=5][b=b] 375 | 376 | [a=1][b=a] 377 | [a=1][b=a] 378 | [a=2][b=a] 379 | [a=3][b=a] 380 | [a=4][b=a] 381 | [a=4][b=a] 382 | [a=4][b=a] 383 | [a=4][b=b] 384 | [a=3][b=b] 385 | [a=3][b=b] 386 | [a=3][b=b] 387 | [a=4][b=b] 388 | [a=4][b=b] 389 | [a=5][b=b] 390 | 391 | [a=1][b=a] 392 | [a=1][b=a] 393 | [a=2][b=a] 394 | [a=3][b=a] 395 | [a=4][b=a] 396 | [a=4][b=a] 397 | [a=4][b=a] 398 | [a=4][b=b] 399 | [a=3][b=b] 400 | [a=3][b=b] 401 | [a=3][b=b] 402 | [a=4][b=b] 403 | [a=4][b=b] 404 | [a=5][b=b] 405 | 406 | [a=1][b=a] 407 | [a=1][b=a] 408 | [a=2][b=a] 409 | [a=3][b=a] 410 | [a=4][b=a] 411 | [a=4][b=a] 412 | [a=4][b=a] 413 | [a=4][b=b] 414 | [a=3][b=b] 415 | [a=3][b=b] 416 | [a=3][b=b] 417 | [a=4][b=b] 418 | [a=4][b=b] 419 | [a=5][b=b] 420 | 421 | [a=1][b=a] 422 | [a=1][b=a] 423 | [a=2][b=a] 424 | [a=3][b=a] 425 | [a=4][b=a] 426 | [a=4][b=a] 427 | [a=4][b=a] 428 | [a=4][b=b] 429 | [a=3][b=b] 430 | [a=3][b=b] 431 | [a=3][b=b] 432 | [a=4][b=b] 433 | [a=4][b=b] 434 | [a=5][b=b] 435 | 436 | [a=1][b=a] 437 | [a=1][b=a] 438 | [a=2][b=a] 439 | [a=3][b=a] 440 | [a=4][b=a] 441 | [a=4][b=a] 442 | [a=4][b=a] 443 | [a=4][b=b] 444 | [a=3][b=b] 445 | [a=3][b=b] 446 | [a=3][b=b] 447 | [a=4][b=b] 448 | [a=4][b=b] 449 | [a=5][b=b] 450 | 451 | [a=1][b=a] 452 | [a=1][b=a] 453 | [a=2][b=a] 454 | [a=3][b=a] 455 | [a=4][b=a] 456 | [a=4][b=a] 457 | [a=4][b=a] 458 | [a=4][b=b] 459 | [a=3][b=b] 460 | [a=3][b=b] 461 | [a=3][b=b] 462 | [a=4][b=b] 463 | [a=4][b=b] 464 | [a=5][b=b] 465 | 466 | [a=1][b=a] 467 | [a=1][b=a] 468 | [a=2][b=a] 469 | [a=3][b=a] 470 | [a=4][b=a] 471 | [a=4][b=a] 472 | [a=4][b=a] 473 | [a=4][b=b] 474 | [a=3][b=b] 475 | [a=3][b=b] 476 | [a=3][b=b] 477 | [a=4][b=b] 478 | [a=4][b=b] 479 | [a=5][b=b] 480 | 481 | [a=1][b=a] 482 | [a=1][b=a] 483 | [a=2][b=a] 484 | [a=3][b=a] 485 | [a=4][b=a] 486 | [a=4][b=a] 487 | [a=4][b=a] 488 | [a=4][b=b] 489 | [a=3][b=b] 490 | [a=3][b=b] 491 | [a=3][b=b] 492 | [a=4][b=b] 493 | [a=4][b=b] 494 | [a=5][b=b] 495 | 496 | [a=1][b=a] 497 | [a=1][b=a] 498 | [a=2][b=a] 499 | [a=3][b=a] 500 | [a=4][b=a] 501 | [a=4][b=a] 502 | [a=4][b=a] 503 | [a=4][b=b] 504 | [a=3][b=b] 505 | [a=3][b=b] 506 | [a=3][b=b] 507 | [a=4][b=b] 508 | [a=4][b=b] 509 | [a=5][b=b] 510 | 511 | [a=1][b=a] 512 | [a=1][b=a] 513 | [a=2][b=a] 514 | [a=3][b=a] 515 | [a=4][b=a] 516 | [a=4][b=a] 517 | [a=4][b=a] 518 | [a=4][b=b] 519 | [a=3][b=b] 520 | [a=3][b=b] 521 | [a=3][b=b] 522 | [a=4][b=b] 523 | [a=4][b=b] 524 | [a=5][b=b] 525 | 526 | [a=1][b=a] 527 | [a=1][b=a] 528 | [a=2][b=a] 529 | [a=3][b=a] 530 | [a=4][b=a] 531 | [a=4][b=a] 532 | [a=4][b=a] 533 | [a=4][b=b] 534 | [a=3][b=b] 535 | [a=3][b=b] 536 | [a=3][b=b] 537 | [a=4][b=b] 538 | [a=4][b=b] 539 | [a=5][b=b] 540 | 541 | [a=1][b=a] 542 | [a=1][b=a] 543 | [a=2][b=a] 544 | [a=3][b=a] 545 | [a=4][b=a] 546 | [a=4][b=a] 547 | [a=4][b=a] 548 | [a=4][b=b] 549 | [a=3][b=b] 550 | [a=3][b=b] 551 | [a=3][b=b] 552 | [a=4][b=b] 553 | [a=4][b=b] 554 | [a=5][b=b] 555 | 556 | [a=1][b=a] 557 | [a=1][b=a] 558 | [a=2][b=a] 559 | [a=3][b=a] 560 | [a=4][b=a] 561 | [a=4][b=a] 562 | [a=4][b=a] 563 | [a=4][b=b] 564 | [a=3][b=b] 565 | [a=3][b=b] 566 | [a=3][b=b] 567 | [a=4][b=b] 568 | [a=4][b=b] 569 | [a=5][b=b] 570 | 571 | [a=1][b=a] 572 | [a=1][b=a] 573 | [a=2][b=a] 574 | [a=3][b=a] 575 | [a=4][b=a] 576 | [a=4][b=a] 577 | [a=4][b=a] 578 | [a=4][b=b] 579 | [a=3][b=b] 580 | [a=3][b=b] 581 | [a=3][b=b] 582 | [a=4][b=b] 583 | [a=4][b=b] 584 | [a=5][b=b] 585 | 586 | [a=1][b=a] 587 | [a=1][b=a] 588 | [a=2][b=a] 589 | [a=3][b=a] 590 | [a=4][b=a] 591 | [a=4][b=a] 592 | [a=4][b=a] 593 | [a=4][b=b] 594 | [a=3][b=b] 595 | [a=3][b=b] 596 | [a=3][b=b] 597 | [a=4][b=b] 598 | [a=4][b=b] 599 | [a=5][b=b] 600 | 601 | [a=1][b=a] 602 | [a=1][b=a] 603 | [a=2][b=a] 604 | [a=3][b=a] 605 | [a=4][b=a] 606 | [a=4][b=a] 607 | [a=4][b=a] 608 | [a=4][b=b] 609 | [a=3][b=b] 610 | [a=3][b=b] 611 | [a=3][b=b] 612 | [a=4][b=b] 613 | [a=4][b=b] 614 | [a=5][b=b] 615 | 616 | [a=1][b=a] 617 | [a=1][b=a] 618 | [a=2][b=a] 619 | [a=3][b=a] 620 | [a=4][b=a] 621 | [a=4][b=a] 622 | [a=4][b=a] 623 | [a=4][b=b] 624 | [a=3][b=b] 625 | [a=3][b=b] 626 | [a=3][b=b] 627 | [a=4][b=b] 628 | [a=4][b=b] 629 | [a=5][b=b] 630 | 631 | [a=1][b=a] 632 | [a=1][b=a] 633 | [a=2][b=a] 634 | [a=3][b=a] 635 | [a=4][b=a] 636 | [a=4][b=a] 637 | [a=4][b=a] 638 | [a=4][b=b] 639 | [a=3][b=b] 640 | [a=3][b=b] 641 | [a=3][b=b] 642 | [a=4][b=b] 643 | [a=4][b=b] 644 | [a=5][b=b] 645 | 646 | [a=1][b=a] 647 | [a=1][b=a] 648 | [a=2][b=a] 649 | [a=3][b=a] 650 | [a=4][b=a] 651 | [a=4][b=a] 652 | [a=4][b=a] 653 | [a=4][b=b] 654 | [a=3][b=b] 655 | [a=3][b=b] 656 | [a=3][b=b] 657 | [a=4][b=b] 658 | [a=4][b=b] 659 | [a=5][b=b] 660 | 661 | [a=1][b=a] 662 | [a=1][b=a] 663 | [a=2][b=a] 664 | [a=3][b=a] 665 | [a=4][b=a] 666 | [a=4][b=a] 667 | [a=4][b=a] 668 | [a=4][b=b] 669 | [a=3][b=b] 670 | [a=3][b=b] 671 | [a=3][b=b] 672 | [a=4][b=b] 673 | [a=4][b=b] 674 | [a=5][b=b] 675 | 676 | [a=1][b=a] 677 | [a=1][b=a] 678 | [a=2][b=a] 679 | [a=3][b=a] 680 | [a=4][b=a] 681 | [a=4][b=a] 682 | [a=4][b=a] 683 | [a=4][b=b] 684 | [a=3][b=b] 685 | [a=3][b=b] 686 | [a=3][b=b] 687 | [a=4][b=b] 688 | [a=4][b=b] 689 | [a=5][b=b] 690 | 691 | [a=1][b=a] 692 | [a=1][b=a] 693 | [a=2][b=a] 694 | [a=3][b=a] 695 | [a=4][b=a] 696 | [a=4][b=a] 697 | [a=4][b=a] 698 | [a=4][b=b] 699 | [a=3][b=b] 700 | [a=3][b=b] 701 | [a=3][b=b] 702 | [a=4][b=b] 703 | [a=4][b=b] 704 | [a=5][b=b] 705 | 706 | [a=1][b=a] 707 | [a=1][b=a] 708 | [a=2][b=a] 709 | [a=3][b=a] 710 | [a=4][b=a] 711 | [a=4][b=a] 712 | [a=4][b=a] 713 | [a=4][b=b] 714 | [a=3][b=b] 715 | [a=3][b=b] 716 | [a=3][b=b] 717 | [a=4][b=b] 718 | [a=4][b=b] 719 | [a=5][b=b] 720 | 721 | [a=1][b=a] 722 | [a=1][b=a] 723 | [a=2][b=a] 724 | [a=3][b=a] 725 | [a=4][b=a] 726 | [a=4][b=a] 727 | [a=4][b=a] 728 | [a=4][b=b] 729 | [a=3][b=b] 730 | [a=3][b=b] 731 | [a=3][b=b] 732 | [a=4][b=b] 733 | [a=4][b=b] 734 | [a=5][b=b] 735 | 736 | [a=1][b=a] 737 | [a=1][b=a] 738 | [a=2][b=a] 739 | [a=3][b=a] 740 | [a=4][b=a] 741 | [a=4][b=a] 742 | [a=4][b=a] 743 | [a=4][b=b] 744 | [a=3][b=b] 745 | [a=3][b=b] 746 | [a=3][b=b] 747 | [a=4][b=b] 748 | [a=4][b=b] 749 | [a=5][b=b] 750 | 751 | [a=1][b=a] 752 | [a=1][b=a] 753 | [a=2][b=a] 754 | [a=3][b=a] 755 | [a=4][b=a] 756 | [a=4][b=a] 757 | [a=4][b=a] 758 | [a=4][b=b] 759 | [a=3][b=b] 760 | [a=3][b=b] 761 | [a=3][b=b] 762 | [a=4][b=b] 763 | [a=4][b=b] 764 | [a=5][b=b] 765 | 766 | [a=1][b=a] 767 | [a=1][b=a] 768 | [a=2][b=a] 769 | [a=3][b=a] 770 | [a=4][b=a] 771 | [a=4][b=a] 772 | [a=4][b=a] 773 | [a=4][b=b] 774 | [a=3][b=b] 775 | [a=3][b=b] 776 | [a=3][b=b] 777 | [a=4][b=b] 778 | [a=4][b=b] 779 | [a=5][b=b] 780 | 781 | [a=1][b=a] 782 | [a=1][b=a] 783 | [a=2][b=a] 784 | [a=3][b=a] 785 | [a=4][b=a] 786 | [a=4][b=a] 787 | [a=4][b=a] 788 | [a=4][b=b] 789 | [a=3][b=b] 790 | [a=3][b=b] 791 | [a=3][b=b] 792 | [a=4][b=b] 793 | [a=4][b=b] 794 | [a=5][b=b] 795 | 796 | [a=1][b=a] 797 | [a=1][b=a] 798 | [a=2][b=a] 799 | [a=3][b=a] 800 | [a=4][b=a] 801 | [a=4][b=a] 802 | [a=4][b=a] 803 | [a=4][b=b] 804 | [a=3][b=b] 805 | [a=3][b=b] 806 | [a=3][b=b] 807 | [a=4][b=b] 808 | [a=4][b=b] 809 | [a=5][b=b] 810 | 811 | [a=1][b=a] 812 | [a=1][b=a] 813 | [a=2][b=a] 814 | [a=3][b=a] 815 | [a=4][b=a] 816 | [a=4][b=a] 817 | [a=4][b=a] 818 | [a=4][b=b] 819 | [a=3][b=b] 820 | [a=3][b=b] 821 | [a=3][b=b] 822 | [a=4][b=b] 823 | [a=4][b=b] 824 | [a=5][b=b] 825 | 826 | [a=1][b=a] 827 | [a=1][b=a] 828 | [a=2][b=a] 829 | [a=3][b=a] 830 | [a=4][b=a] 831 | [a=4][b=a] 832 | [a=4][b=a] 833 | [a=4][b=b] 834 | [a=3][b=b] 835 | [a=3][b=b] 836 | [a=3][b=b] 837 | [a=4][b=b] 838 | [a=4][b=b] 839 | [a=5][b=b] 840 | 841 | [a=1][b=a] 842 | [a=1][b=a] 843 | [a=2][b=a] 844 | [a=3][b=a] 845 | [a=4][b=a] 846 | [a=4][b=a] 847 | [a=4][b=a] 848 | [a=4][b=b] 849 | [a=3][b=b] 850 | [a=3][b=b] 851 | [a=3][b=b] 852 | [a=4][b=b] 853 | [a=4][b=b] 854 | [a=5][b=b] 855 | 856 | [a=1][b=a] 857 | [a=1][b=a] 858 | [a=2][b=a] 859 | [a=3][b=a] 860 | [a=4][b=a] 861 | [a=4][b=a] 862 | [a=4][b=a] 863 | [a=4][b=b] 864 | [a=3][b=b] 865 | [a=3][b=b] 866 | [a=3][b=b] 867 | [a=4][b=b] 868 | [a=4][b=b] 869 | [a=5][b=b] 870 | 871 | [a=1][b=a] 872 | [a=1][b=a] 873 | [a=2][b=a] 874 | [a=3][b=a] 875 | [a=4][b=a] 876 | [a=4][b=a] 877 | [a=4][b=a] 878 | [a=4][b=b] 879 | [a=3][b=b] 880 | [a=3][b=b] 881 | [a=3][b=b] 882 | [a=4][b=b] 883 | [a=4][b=b] 884 | [a=5][b=b] 885 | 886 | [a=1][b=a] 887 | [a=1][b=a] 888 | [a=2][b=a] 889 | [a=3][b=a] 890 | [a=4][b=a] 891 | [a=4][b=a] 892 | [a=4][b=a] 893 | [a=4][b=b] 894 | [a=3][b=b] 895 | [a=3][b=b] 896 | [a=3][b=b] 897 | [a=4][b=b] 898 | [a=4][b=b] 899 | [a=5][b=b] 900 | 901 | [a=1][b=a] 902 | [a=1][b=a] 903 | [a=2][b=a] 904 | [a=3][b=a] 905 | [a=4][b=a] 906 | [a=4][b=a] 907 | [a=4][b=a] 908 | [a=4][b=b] 909 | [a=3][b=b] 910 | [a=3][b=b] 911 | [a=3][b=b] 912 | [a=4][b=b] 913 | [a=4][b=b] 914 | [a=5][b=b] 915 | 916 | [a=1][b=a] 917 | [a=1][b=a] 918 | [a=2][b=a] 919 | [a=3][b=a] 920 | [a=4][b=a] 921 | [a=4][b=a] 922 | [a=4][b=a] 923 | [a=4][b=b] 924 | [a=3][b=b] 925 | [a=3][b=b] 926 | [a=3][b=b] 927 | [a=4][b=b] 928 | [a=4][b=b] 929 | [a=5][b=b] 930 | 931 | [a=1][b=a] 932 | [a=1][b=a] 933 | [a=2][b=a] 934 | [a=3][b=a] 935 | [a=4][b=a] 936 | [a=4][b=a] 937 | [a=4][b=a] 938 | [a=4][b=b] 939 | [a=3][b=b] 940 | [a=3][b=b] 941 | [a=3][b=b] 942 | [a=4][b=b] 943 | [a=4][b=b] 944 | [a=5][b=b] 945 | 946 | [a=1][b=a] 947 | [a=1][b=a] 948 | [a=2][b=a] 949 | [a=3][b=a] 950 | [a=4][b=a] 951 | [a=4][b=a] 952 | [a=4][b=a] 953 | [a=4][b=b] 954 | [a=3][b=b] 955 | [a=3][b=b] 956 | [a=3][b=b] 957 | [a=4][b=b] 958 | [a=4][b=b] 959 | [a=5][b=b] 960 | 961 | [a=1][b=a] 962 | [a=1][b=a] 963 | [a=2][b=a] 964 | [a=3][b=a] 965 | [a=4][b=a] 966 | [a=4][b=a] 967 | [a=4][b=a] 968 | [a=4][b=b] 969 | [a=3][b=b] 970 | [a=3][b=b] 971 | [a=3][b=b] 972 | [a=4][b=b] 973 | [a=4][b=b] 974 | [a=5][b=b] 975 | 976 | [a=1][b=a] 977 | [a=1][b=a] 978 | [a=2][b=a] 979 | [a=3][b=a] 980 | [a=4][b=a] 981 | [a=4][b=a] 982 | [a=4][b=a] 983 | [a=4][b=b] 984 | [a=3][b=b] 985 | [a=3][b=b] 986 | [a=3][b=b] 987 | [a=4][b=b] 988 | [a=4][b=b] 989 | [a=5][b=b] 990 | 991 | [a=1][b=a] 992 | [a=1][b=a] 993 | [a=2][b=a] 994 | [a=3][b=a] 995 | [a=4][b=a] 996 | [a=4][b=a] 997 | [a=4][b=a] 998 | [a=4][b=b] 999 | [a=3][b=b] 1000 | [a=3][b=b] 1001 | [a=3][b=b] 1002 | [a=4][b=b] 1003 | [a=4][b=b] 1004 | [a=5][b=b] 1005 | 1006 | [a=1][b=a] 1007 | [a=1][b=a] 1008 | [a=2][b=a] 1009 | [a=3][b=a] 1010 | [a=4][b=a] 1011 | [a=4][b=a] 1012 | [a=4][b=a] 1013 | [a=4][b=b] 1014 | [a=3][b=b] 1015 | [a=3][b=b] 1016 | [a=3][b=b] 1017 | [a=4][b=b] 1018 | [a=4][b=b] 1019 | [a=5][b=b] 1020 | 1021 | [a=1][b=a] 1022 | [a=1][b=a] 1023 | [a=2][b=a] 1024 | [a=3][b=a] 1025 | [a=4][b=a] 1026 | [a=4][b=a] 1027 | [a=4][b=a] 1028 | [a=4][b=b] 1029 | [a=3][b=b] 1030 | [a=3][b=b] 1031 | [a=3][b=b] 1032 | [a=4][b=b] 1033 | [a=4][b=b] 1034 | [a=5][b=b] 1035 | 1036 | [a=1][b=a] 1037 | [a=1][b=a] 1038 | [a=2][b=a] 1039 | [a=3][b=a] 1040 | [a=4][b=a] 1041 | [a=4][b=a] 1042 | [a=4][b=a] 1043 | [a=4][b=b] 1044 | [a=3][b=b] 1045 | [a=3][b=b] 1046 | [a=3][b=b] 1047 | [a=4][b=b] 1048 | [a=4][b=b] 1049 | [a=5][b=b] 1050 | 1051 | [a=1][b=a] 1052 | [a=1][b=a] 1053 | [a=2][b=a] 1054 | [a=3][b=a] 1055 | [a=4][b=a] 1056 | [a=4][b=a] 1057 | [a=4][b=a] 1058 | [a=4][b=b] 1059 | [a=3][b=b] 1060 | [a=3][b=b] 1061 | [a=3][b=b] 1062 | [a=4][b=b] 1063 | [a=4][b=b] 1064 | [a=5][b=b] 1065 | 1066 | [a=1][b=a] 1067 | [a=1][b=a] 1068 | [a=2][b=a] 1069 | [a=3][b=a] 1070 | [a=4][b=a] 1071 | [a=4][b=a] 1072 | [a=4][b=a] 1073 | [a=4][b=b] 1074 | [a=3][b=b] 1075 | [a=3][b=b] 1076 | [a=3][b=b] 1077 | [a=4][b=b] 1078 | [a=4][b=b] 1079 | [a=5][b=b] 1080 | 1081 | [a=1][b=a] 1082 | [a=1][b=a] 1083 | [a=2][b=a] 1084 | [a=3][b=a] 1085 | [a=4][b=a] 1086 | [a=4][b=a] 1087 | [a=4][b=a] 1088 | [a=4][b=b] 1089 | [a=3][b=b] 1090 | [a=3][b=b] 1091 | [a=3][b=b] 1092 | [a=4][b=b] 1093 | [a=4][b=b] 1094 | [a=5][b=b] 1095 | 1096 | [a=1][b=a] 1097 | [a=1][b=a] 1098 | [a=2][b=a] 1099 | [a=3][b=a] 1100 | [a=4][b=a] 1101 | [a=4][b=a] 1102 | [a=4][b=a] 1103 | [a=4][b=b] 1104 | [a=3][b=b] 1105 | [a=3][b=b] 1106 | [a=3][b=b] 1107 | [a=4][b=b] 1108 | [a=4][b=b] 1109 | [a=5][b=b] 1110 | 1111 | [a=1][b=a] 1112 | [a=1][b=a] 1113 | [a=2][b=a] 1114 | [a=3][b=a] 1115 | [a=4][b=a] 1116 | [a=4][b=a] 1117 | [a=4][b=a] 1118 | [a=4][b=b] 1119 | [a=3][b=b] 1120 | [a=3][b=b] 1121 | [a=3][b=b] 1122 | [a=4][b=b] 1123 | [a=4][b=b] 1124 | [a=5][b=b] 1125 | 1126 | [a=1][b=a] 1127 | [a=1][b=a] 1128 | [a=2][b=a] 1129 | [a=3][b=a] 1130 | [a=4][b=a] 1131 | [a=4][b=a] 1132 | [a=4][b=a] 1133 | [a=4][b=b] 1134 | [a=3][b=b] 1135 | [a=3][b=b] 1136 | [a=3][b=b] 1137 | [a=4][b=b] 1138 | [a=4][b=b] 1139 | [a=5][b=b] 1140 | 1141 | [a=1][b=a] 1142 | [a=1][b=a] 1143 | [a=2][b=a] 1144 | [a=3][b=a] 1145 | [a=4][b=a] 1146 | [a=4][b=a] 1147 | [a=4][b=a] 1148 | [a=4][b=b] 1149 | [a=3][b=b] 1150 | [a=3][b=b] 1151 | [a=3][b=b] 1152 | [a=4][b=b] 1153 | [a=4][b=b] 1154 | [a=5][b=b] 1155 | 1156 | [a=1][b=a] 1157 | [a=1][b=a] 1158 | [a=2][b=a] 1159 | [a=3][b=a] 1160 | [a=4][b=a] 1161 | [a=4][b=a] 1162 | [a=4][b=a] 1163 | [a=4][b=b] 1164 | [a=3][b=b] 1165 | [a=3][b=b] 1166 | [a=3][b=b] 1167 | [a=4][b=b] 1168 | [a=4][b=b] 1169 | [a=5][b=b] 1170 | 1171 | [a=1][b=a] 1172 | [a=1][b=a] 1173 | [a=2][b=a] 1174 | [a=3][b=a] 1175 | [a=4][b=a] 1176 | [a=4][b=a] 1177 | [a=4][b=a] 1178 | [a=4][b=b] 1179 | [a=3][b=b] 1180 | [a=3][b=b] 1181 | [a=3][b=b] 1182 | [a=4][b=b] 1183 | [a=4][b=b] 1184 | [a=5][b=b] 1185 | 1186 | [a=1][b=a] 1187 | [a=1][b=a] 1188 | [a=2][b=a] 1189 | [a=3][b=a] 1190 | [a=4][b=a] 1191 | [a=4][b=a] 1192 | [a=4][b=a] 1193 | [a=4][b=b] 1194 | [a=3][b=b] 1195 | [a=3][b=b] 1196 | [a=3][b=b] 1197 | [a=4][b=b] 1198 | [a=4][b=b] 1199 | [a=5][b=b] 1200 | 1201 | [a=1][b=a] 1202 | [a=1][b=a] 1203 | [a=2][b=a] 1204 | [a=3][b=a] 1205 | [a=4][b=a] 1206 | [a=4][b=a] 1207 | [a=4][b=a] 1208 | [a=4][b=b] 1209 | [a=3][b=b] 1210 | [a=3][b=b] 1211 | [a=3][b=b] 1212 | [a=4][b=b] 1213 | [a=4][b=b] 1214 | [a=5][b=b] 1215 | 1216 | [a=1][b=a] 1217 | [a=1][b=a] 1218 | [a=2][b=a] 1219 | [a=3][b=a] 1220 | [a=4][b=a] 1221 | [a=4][b=a] 1222 | [a=4][b=a] 1223 | [a=4][b=b] 1224 | [a=3][b=b] 1225 | [a=3][b=b] 1226 | [a=3][b=b] 1227 | [a=4][b=b] 1228 | [a=4][b=b] 1229 | [a=5][b=b] 1230 | 1231 | [a=1][b=a] 1232 | [a=1][b=a] 1233 | [a=2][b=a] 1234 | [a=3][b=a] 1235 | [a=4][b=a] 1236 | [a=4][b=a] 1237 | [a=4][b=a] 1238 | [a=4][b=b] 1239 | [a=3][b=b] 1240 | [a=3][b=b] 1241 | [a=3][b=b] 1242 | [a=4][b=b] 1243 | [a=4][b=b] 1244 | [a=5][b=b] 1245 | 1246 | [a=1][b=a] 1247 | [a=1][b=a] 1248 | [a=2][b=a] 1249 | [a=3][b=a] 1250 | [a=4][b=a] 1251 | [a=4][b=a] 1252 | [a=4][b=a] 1253 | [a=4][b=b] 1254 | [a=3][b=b] 1255 | [a=3][b=b] 1256 | [a=3][b=b] 1257 | [a=4][b=b] 1258 | [a=4][b=b] 1259 | [a=5][b=b] 1260 | 1261 | [a=1][b=a] 1262 | [a=1][b=a] 1263 | [a=2][b=a] 1264 | [a=3][b=a] 1265 | [a=4][b=a] 1266 | [a=4][b=a] 1267 | [a=4][b=a] 1268 | [a=4][b=b] 1269 | [a=3][b=b] 1270 | [a=3][b=b] 1271 | [a=3][b=b] 1272 | [a=4][b=b] 1273 | [a=4][b=b] 1274 | [a=5][b=b] 1275 | 1276 | [a=1][b=a] 1277 | [a=1][b=a] 1278 | [a=2][b=a] 1279 | [a=3][b=a] 1280 | [a=4][b=a] 1281 | [a=4][b=a] 1282 | [a=4][b=a] 1283 | [a=4][b=b] 1284 | [a=3][b=b] 1285 | [a=3][b=b] 1286 | [a=3][b=b] 1287 | [a=4][b=b] 1288 | [a=4][b=b] 1289 | [a=5][b=b] 1290 | 1291 | [a=1][b=a] 1292 | [a=1][b=a] 1293 | [a=2][b=a] 1294 | [a=3][b=a] 1295 | [a=4][b=a] 1296 | [a=4][b=a] 1297 | [a=4][b=a] 1298 | [a=4][b=b] 1299 | [a=3][b=b] 1300 | [a=3][b=b] 1301 | [a=3][b=b] 1302 | [a=4][b=b] 1303 | [a=4][b=b] 1304 | [a=5][b=b] 1305 | 1306 | [a=1][b=a] 1307 | [a=1][b=a] 1308 | [a=2][b=a] 1309 | [a=3][b=a] 1310 | [a=4][b=a] 1311 | [a=4][b=a] 1312 | [a=4][b=a] 1313 | [a=4][b=b] 1314 | [a=3][b=b] 1315 | [a=3][b=b] 1316 | [a=3][b=b] 1317 | [a=4][b=b] 1318 | [a=4][b=b] 1319 | [a=5][b=b] 1320 | 1321 | [a=1][b=a] 1322 | [a=1][b=a] 1323 | [a=2][b=a] 1324 | [a=3][b=a] 1325 | [a=4][b=a] 1326 | [a=4][b=a] 1327 | [a=4][b=a] 1328 | [a=4][b=b] 1329 | [a=3][b=b] 1330 | [a=3][b=b] 1331 | [a=3][b=b] 1332 | [a=4][b=b] 1333 | [a=4][b=b] 1334 | [a=5][b=b] 1335 | 1336 | [a=1][b=a] 1337 | [a=1][b=a] 1338 | [a=2][b=a] 1339 | [a=3][b=a] 1340 | [a=4][b=a] 1341 | [a=4][b=a] 1342 | [a=4][b=a] 1343 | [a=4][b=b] 1344 | [a=3][b=b] 1345 | [a=3][b=b] 1346 | [a=3][b=b] 1347 | [a=4][b=b] 1348 | [a=4][b=b] 1349 | [a=5][b=b] 1350 | 1351 | [a=1][b=a] 1352 | [a=1][b=a] 1353 | [a=2][b=a] 1354 | [a=3][b=a] 1355 | [a=4][b=a] 1356 | [a=4][b=a] 1357 | [a=4][b=a] 1358 | [a=4][b=b] 1359 | [a=3][b=b] 1360 | [a=3][b=b] 1361 | [a=3][b=b] 1362 | [a=4][b=b] 1363 | [a=4][b=b] 1364 | [a=5][b=b] 1365 | 1366 | [a=1][b=a] 1367 | [a=1][b=a] 1368 | [a=2][b=a] 1369 | [a=3][b=a] 1370 | [a=4][b=a] 1371 | [a=4][b=a] 1372 | [a=4][b=a] 1373 | [a=4][b=b] 1374 | [a=3][b=b] 1375 | [a=3][b=b] 1376 | [a=3][b=b] 1377 | [a=4][b=b] 1378 | [a=4][b=b] 1379 | [a=5][b=b] 1380 | 1381 | [a=1][b=a] 1382 | [a=1][b=a] 1383 | [a=2][b=a] 1384 | [a=3][b=a] 1385 | [a=4][b=a] 1386 | [a=4][b=a] 1387 | [a=4][b=a] 1388 | [a=4][b=b] 1389 | [a=3][b=b] 1390 | [a=3][b=b] 1391 | [a=3][b=b] 1392 | [a=4][b=b] 1393 | [a=4][b=b] 1394 | [a=5][b=b] 1395 | 1396 | [a=1][b=a] 1397 | [a=1][b=a] 1398 | [a=2][b=a] 1399 | [a=3][b=a] 1400 | [a=4][b=a] 1401 | [a=4][b=a] 1402 | [a=4][b=a] 1403 | [a=4][b=b] 1404 | [a=3][b=b] 1405 | [a=3][b=b] 1406 | [a=3][b=b] 1407 | [a=4][b=b] 1408 | [a=4][b=b] 1409 | [a=5][b=b] 1410 | 1411 | [a=1][b=a] 1412 | [a=1][b=a] 1413 | [a=2][b=a] 1414 | [a=3][b=a] 1415 | [a=4][b=a] 1416 | [a=4][b=a] 1417 | [a=4][b=a] 1418 | [a=4][b=b] 1419 | [a=3][b=b] 1420 | [a=3][b=b] 1421 | [a=3][b=b] 1422 | [a=4][b=b] 1423 | [a=4][b=b] 1424 | [a=5][b=b] 1425 | 1426 | [a=1][b=a] 1427 | [a=1][b=a] 1428 | [a=2][b=a] 1429 | [a=3][b=a] 1430 | [a=4][b=a] 1431 | [a=4][b=a] 1432 | [a=4][b=a] 1433 | [a=4][b=b] 1434 | [a=3][b=b] 1435 | [a=3][b=b] 1436 | [a=3][b=b] 1437 | [a=4][b=b] 1438 | [a=4][b=b] 1439 | [a=5][b=b] 1440 | 1441 | [a=1][b=a] 1442 | [a=1][b=a] 1443 | [a=2][b=a] 1444 | [a=3][b=a] 1445 | [a=4][b=a] 1446 | [a=4][b=a] 1447 | [a=4][b=a] 1448 | [a=4][b=b] 1449 | [a=3][b=b] 1450 | [a=3][b=b] 1451 | [a=3][b=b] 1452 | [a=4][b=b] 1453 | [a=4][b=b] 1454 | [a=5][b=b] 1455 | 1456 | [a=1][b=a] 1457 | [a=1][b=a] 1458 | [a=2][b=a] 1459 | [a=3][b=a] 1460 | [a=4][b=a] 1461 | [a=4][b=a] 1462 | [a=4][b=a] 1463 | [a=4][b=b] 1464 | [a=3][b=b] 1465 | [a=3][b=b] 1466 | [a=3][b=b] 1467 | [a=4][b=b] 1468 | [a=4][b=b] 1469 | [a=5][b=b] 1470 | 1471 | [a=1][b=a] 1472 | [a=1][b=a] 1473 | [a=2][b=a] 1474 | [a=3][b=a] 1475 | [a=4][b=a] 1476 | [a=4][b=a] 1477 | [a=4][b=a] 1478 | [a=4][b=b] 1479 | [a=3][b=b] 1480 | [a=3][b=b] 1481 | [a=3][b=b] 1482 | [a=4][b=b] 1483 | [a=4][b=b] 1484 | [a=5][b=b] 1485 | 1486 | [a=1][b=a] 1487 | [a=1][b=a] 1488 | [a=2][b=a] 1489 | [a=3][b=a] 1490 | [a=4][b=a] 1491 | [a=4][b=a] 1492 | [a=4][b=a] 1493 | [a=4][b=b] 1494 | [a=3][b=b] 1495 | [a=3][b=b] 1496 | [a=3][b=b] 1497 | [a=4][b=b] 1498 | [a=4][b=b] 1499 | [a=5][b=b] 1500 | 1501 | [a=1][b=a] 1502 | [a=1][b=a] 1503 | [a=2][b=a] 1504 | [a=3][b=a] 1505 | [a=4][b=a] 1506 | [a=4][b=a] 1507 | [a=4][b=a] 1508 | [a=4][b=b] 1509 | [a=3][b=b] 1510 | [a=3][b=b] 1511 | [a=3][b=b] 1512 | [a=4][b=b] 1513 | [a=4][b=b] 1514 | [a=5][b=b] 1515 | 1516 | [a=1][b=a] 1517 | [a=1][b=a] 1518 | [a=2][b=a] 1519 | [a=3][b=a] 1520 | [a=4][b=a] 1521 | [a=4][b=a] 1522 | [a=4][b=a] 1523 | [a=4][b=b] 1524 | [a=3][b=b] 1525 | [a=3][b=b] 1526 | [a=3][b=b] 1527 | [a=4][b=b] 1528 | [a=4][b=b] 1529 | [a=5][b=b] 1530 | 1531 | [a=1][b=a] 1532 | [a=1][b=a] 1533 | [a=2][b=a] 1534 | [a=3][b=a] 1535 | [a=4][b=a] 1536 | [a=4][b=a] 1537 | [a=4][b=a] 1538 | [a=4][b=b] 1539 | [a=3][b=b] 1540 | [a=3][b=b] 1541 | [a=3][b=b] 1542 | [a=4][b=b] 1543 | [a=4][b=b] 1544 | [a=5][b=b] 1545 | 1546 | [a=1][b=a] 1547 | [a=1][b=a] 1548 | [a=2][b=a] 1549 | [a=3][b=a] 1550 | [a=4][b=a] 1551 | [a=4][b=a] 1552 | [a=4][b=a] 1553 | [a=4][b=b] 1554 | [a=3][b=b] 1555 | [a=3][b=b] 1556 | [a=3][b=b] 1557 | [a=4][b=b] 1558 | [a=4][b=b] 1559 | [a=5][b=b] 1560 | 1561 | [a=1][b=a] 1562 | [a=1][b=a] 1563 | [a=2][b=a] 1564 | [a=3][b=a] 1565 | [a=4][b=a] 1566 | [a=4][b=a] 1567 | [a=4][b=a] 1568 | [a=4][b=b] 1569 | [a=3][b=b] 1570 | [a=3][b=b] 1571 | [a=3][b=b] 1572 | [a=4][b=b] 1573 | [a=4][b=b] 1574 | [a=5][b=b] 1575 | 1576 | [a=1][b=a] 1577 | [a=1][b=a] 1578 | [a=2][b=a] 1579 | [a=3][b=a] 1580 | [a=4][b=a] 1581 | [a=4][b=a] 1582 | [a=4][b=a] 1583 | [a=4][b=b] 1584 | [a=3][b=b] 1585 | [a=3][b=b] 1586 | [a=3][b=b] 1587 | [a=4][b=b] 1588 | [a=4][b=b] 1589 | [a=5][b=b] 1590 | 1591 | [a=1][b=a] 1592 | [a=1][b=a] 1593 | [a=2][b=a] 1594 | [a=3][b=a] 1595 | [a=4][b=a] 1596 | [a=4][b=a] 1597 | [a=4][b=a] 1598 | [a=4][b=b] 1599 | [a=3][b=b] 1600 | [a=3][b=b] 1601 | [a=3][b=b] 1602 | [a=4][b=b] 1603 | [a=4][b=b] 1604 | [a=5][b=b] 1605 | 1606 | [a=1][b=a] 1607 | [a=1][b=a] 1608 | [a=2][b=a] 1609 | [a=3][b=a] 1610 | [a=4][b=a] 1611 | [a=4][b=a] 1612 | [a=4][b=a] 1613 | [a=4][b=b] 1614 | [a=3][b=b] 1615 | [a=3][b=b] 1616 | [a=3][b=b] 1617 | [a=4][b=b] 1618 | [a=4][b=b] 1619 | [a=5][b=b] 1620 | 1621 | [a=1][b=a] 1622 | [a=1][b=a] 1623 | [a=2][b=a] 1624 | [a=3][b=a] 1625 | [a=4][b=a] 1626 | [a=4][b=a] 1627 | [a=4][b=a] 1628 | [a=4][b=b] 1629 | [a=3][b=b] 1630 | [a=3][b=b] 1631 | [a=3][b=b] 1632 | [a=4][b=b] 1633 | [a=4][b=b] 1634 | [a=5][b=b] 1635 | 1636 | [a=1][b=a] 1637 | [a=1][b=a] 1638 | [a=2][b=a] 1639 | [a=3][b=a] 1640 | [a=4][b=a] 1641 | [a=4][b=a] 1642 | [a=4][b=a] 1643 | [a=4][b=b] 1644 | [a=3][b=b] 1645 | [a=3][b=b] 1646 | [a=3][b=b] 1647 | [a=4][b=b] 1648 | [a=4][b=b] 1649 | [a=5][b=b] 1650 | 1651 | [a=1][b=a] 1652 | [a=1][b=a] 1653 | [a=2][b=a] 1654 | [a=3][b=a] 1655 | [a=4][b=a] 1656 | [a=4][b=a] 1657 | [a=4][b=a] 1658 | [a=4][b=b] 1659 | [a=3][b=b] 1660 | [a=3][b=b] 1661 | [a=3][b=b] 1662 | [a=4][b=b] 1663 | [a=4][b=b] 1664 | [a=5][b=b] 1665 | 1666 | [a=1][b=a] 1667 | [a=1][b=a] 1668 | [a=2][b=a] 1669 | [a=3][b=a] 1670 | [a=4][b=a] 1671 | [a=4][b=a] 1672 | [a=4][b=a] 1673 | [a=4][b=b] 1674 | [a=3][b=b] 1675 | [a=3][b=b] 1676 | [a=3][b=b] 1677 | [a=4][b=b] 1678 | [a=4][b=b] 1679 | [a=5][b=b] 1680 | 1681 | [a=1][b=a] 1682 | [a=1][b=a] 1683 | [a=2][b=a] 1684 | [a=3][b=a] 1685 | [a=4][b=a] 1686 | [a=4][b=a] 1687 | [a=4][b=a] 1688 | [a=4][b=b] 1689 | [a=3][b=b] 1690 | [a=3][b=b] 1691 | [a=3][b=b] 1692 | [a=4][b=b] 1693 | [a=4][b=b] 1694 | [a=5][b=b] 1695 | 1696 | [a=1][b=a] 1697 | [a=1][b=a] 1698 | [a=2][b=a] 1699 | [a=3][b=a] 1700 | [a=4][b=a] 1701 | [a=4][b=a] 1702 | [a=4][b=a] 1703 | [a=4][b=b] 1704 | [a=3][b=b] 1705 | [a=3][b=b] 1706 | [a=3][b=b] 1707 | [a=4][b=b] 1708 | [a=4][b=b] 1709 | [a=5][b=b] 1710 | 1711 | [a=1][b=a] 1712 | [a=1][b=a] 1713 | [a=2][b=a] 1714 | [a=3][b=a] 1715 | [a=4][b=a] 1716 | [a=4][b=a] 1717 | [a=4][b=a] 1718 | [a=4][b=b] 1719 | [a=3][b=b] 1720 | [a=3][b=b] 1721 | [a=3][b=b] 1722 | [a=4][b=b] 1723 | [a=4][b=b] 1724 | [a=5][b=b] 1725 | 1726 | [a=1][b=a] 1727 | [a=1][b=a] 1728 | [a=2][b=a] 1729 | [a=3][b=a] 1730 | [a=4][b=a] 1731 | [a=4][b=a] 1732 | [a=4][b=a] 1733 | [a=4][b=b] 1734 | [a=3][b=b] 1735 | [a=3][b=b] 1736 | [a=3][b=b] 1737 | [a=4][b=b] 1738 | [a=4][b=b] 1739 | [a=5][b=b] 1740 | 1741 | [a=1][b=a] 1742 | [a=1][b=a] 1743 | [a=2][b=a] 1744 | [a=3][b=a] 1745 | [a=4][b=a] 1746 | [a=4][b=a] 1747 | [a=4][b=a] 1748 | [a=4][b=b] 1749 | [a=3][b=b] 1750 | [a=3][b=b] 1751 | [a=3][b=b] 1752 | [a=4][b=b] 1753 | [a=4][b=b] 1754 | [a=5][b=b] 1755 | 1756 | [a=1][b=a] 1757 | [a=1][b=a] 1758 | [a=2][b=a] 1759 | [a=3][b=a] 1760 | [a=4][b=a] 1761 | [a=4][b=a] 1762 | [a=4][b=a] 1763 | [a=4][b=b] 1764 | [a=3][b=b] 1765 | [a=3][b=b] 1766 | [a=3][b=b] 1767 | [a=4][b=b] 1768 | [a=4][b=b] 1769 | [a=5][b=b] 1770 | 1771 | [a=1][b=a] 1772 | [a=1][b=a] 1773 | [a=2][b=a] 1774 | [a=3][b=a] 1775 | [a=4][b=a] 1776 | [a=4][b=a] 1777 | [a=4][b=a] 1778 | [a=4][b=b] 1779 | [a=3][b=b] 1780 | [a=3][b=b] 1781 | [a=3][b=b] 1782 | [a=4][b=b] 1783 | [a=4][b=b] 1784 | [a=5][b=b] 1785 | 1786 | [a=1][b=a] 1787 | [a=1][b=a] 1788 | [a=2][b=a] 1789 | [a=3][b=a] 1790 | [a=4][b=a] 1791 | [a=4][b=a] 1792 | [a=4][b=a] 1793 | [a=4][b=b] 1794 | [a=3][b=b] 1795 | [a=3][b=b] 1796 | [a=3][b=b] 1797 | [a=4][b=b] 1798 | [a=4][b=b] 1799 | [a=5][b=b] 1800 | 1801 | [a=1][b=a] 1802 | [a=1][b=a] 1803 | [a=2][b=a] 1804 | [a=3][b=a] 1805 | [a=4][b=a] 1806 | [a=4][b=a] 1807 | [a=4][b=a] 1808 | [a=4][b=b] 1809 | [a=3][b=b] 1810 | [a=3][b=b] 1811 | [a=3][b=b] 1812 | [a=4][b=b] 1813 | [a=4][b=b] 1814 | [a=5][b=b] 1815 | 1816 | [a=1][b=a] 1817 | [a=1][b=a] 1818 | [a=2][b=a] 1819 | [a=3][b=a] 1820 | [a=4][b=a] 1821 | [a=4][b=a] 1822 | [a=4][b=a] 1823 | [a=4][b=b] 1824 | [a=3][b=b] 1825 | [a=3][b=b] 1826 | [a=3][b=b] 1827 | [a=4][b=b] 1828 | [a=4][b=b] 1829 | [a=5][b=b] 1830 | 1831 | [a=1][b=a] 1832 | [a=1][b=a] 1833 | [a=2][b=a] 1834 | [a=3][b=a] 1835 | [a=4][b=a] 1836 | [a=4][b=a] 1837 | [a=4][b=a] 1838 | [a=4][b=b] 1839 | [a=3][b=b] 1840 | [a=3][b=b] 1841 | [a=3][b=b] 1842 | [a=4][b=b] 1843 | [a=4][b=b] 1844 | [a=5][b=b] 1845 | 1846 | [a=1][b=a] 1847 | [a=1][b=a] 1848 | [a=2][b=a] 1849 | [a=3][b=a] 1850 | [a=4][b=a] 1851 | [a=4][b=a] 1852 | [a=4][b=a] 1853 | [a=4][b=b] 1854 | [a=3][b=b] 1855 | [a=3][b=b] 1856 | [a=3][b=b] 1857 | [a=4][b=b] 1858 | [a=4][b=b] 1859 | [a=5][b=b] 1860 | 1861 | [a=1][b=a] 1862 | [a=1][b=a] 1863 | [a=2][b=a] 1864 | [a=3][b=a] 1865 | [a=4][b=a] 1866 | [a=4][b=a] 1867 | [a=4][b=a] 1868 | [a=4][b=b] 1869 | [a=3][b=b] 1870 | [a=3][b=b] 1871 | [a=3][b=b] 1872 | [a=4][b=b] 1873 | [a=4][b=b] 1874 | [a=5][b=b] 1875 | 1876 | [a=1][b=a] 1877 | [a=1][b=a] 1878 | [a=2][b=a] 1879 | [a=3][b=a] 1880 | [a=4][b=a] 1881 | [a=4][b=a] 1882 | [a=4][b=a] 1883 | [a=4][b=b] 1884 | [a=3][b=b] 1885 | [a=3][b=b] 1886 | [a=3][b=b] 1887 | [a=4][b=b] 1888 | [a=4][b=b] 1889 | [a=5][b=b] 1890 | 1891 | [a=1][b=a] 1892 | [a=1][b=a] 1893 | [a=2][b=a] 1894 | [a=3][b=a] 1895 | [a=4][b=a] 1896 | [a=4][b=a] 1897 | [a=4][b=a] 1898 | [a=4][b=b] 1899 | [a=3][b=b] 1900 | [a=3][b=b] 1901 | [a=3][b=b] 1902 | [a=4][b=b] 1903 | [a=4][b=b] 1904 | [a=5][b=b] 1905 | 1906 | [a=1][b=a] 1907 | [a=1][b=a] 1908 | [a=2][b=a] 1909 | [a=3][b=a] 1910 | [a=4][b=a] 1911 | [a=4][b=a] 1912 | [a=4][b=a] 1913 | [a=4][b=b] 1914 | [a=3][b=b] 1915 | [a=3][b=b] 1916 | [a=3][b=b] 1917 | [a=4][b=b] 1918 | [a=4][b=b] 1919 | [a=5][b=b] 1920 | 1921 | [a=1][b=a] 1922 | [a=1][b=a] 1923 | [a=2][b=a] 1924 | [a=3][b=a] 1925 | [a=4][b=a] 1926 | [a=4][b=a] 1927 | [a=4][b=a] 1928 | [a=4][b=b] 1929 | [a=3][b=b] 1930 | [a=3][b=b] 1931 | [a=3][b=b] 1932 | [a=4][b=b] 1933 | [a=4][b=b] 1934 | [a=5][b=b] 1935 | 1936 | [a=1][b=a] 1937 | [a=1][b=a] 1938 | [a=2][b=a] 1939 | [a=3][b=a] 1940 | [a=4][b=a] 1941 | [a=4][b=a] 1942 | [a=4][b=a] 1943 | [a=4][b=b] 1944 | [a=3][b=b] 1945 | [a=3][b=b] 1946 | [a=3][b=b] 1947 | [a=4][b=b] 1948 | [a=4][b=b] 1949 | [a=5][b=b] 1950 | 1951 | [a=1][b=a] 1952 | [a=1][b=a] 1953 | [a=2][b=a] 1954 | [a=3][b=a] 1955 | [a=4][b=a] 1956 | [a=4][b=a] 1957 | [a=4][b=a] 1958 | [a=4][b=b] 1959 | [a=3][b=b] 1960 | [a=3][b=b] 1961 | [a=3][b=b] 1962 | [a=4][b=b] 1963 | [a=4][b=b] 1964 | [a=5][b=b] 1965 | 1966 | [a=1][b=a] 1967 | [a=1][b=a] 1968 | [a=2][b=a] 1969 | [a=3][b=a] 1970 | [a=4][b=a] 1971 | [a=4][b=a] 1972 | [a=4][b=a] 1973 | [a=4][b=b] 1974 | [a=3][b=b] 1975 | [a=3][b=b] 1976 | [a=3][b=b] 1977 | [a=4][b=b] 1978 | [a=4][b=b] 1979 | [a=5][b=b] 1980 | 1981 | [a=1][b=a] 1982 | [a=1][b=a] 1983 | [a=2][b=a] 1984 | [a=3][b=a] 1985 | [a=4][b=a] 1986 | [a=4][b=a] 1987 | [a=4][b=a] 1988 | [a=4][b=b] 1989 | [a=3][b=b] 1990 | [a=3][b=b] 1991 | [a=3][b=b] 1992 | [a=4][b=b] 1993 | [a=4][b=b] 1994 | [a=5][b=b] 1995 | 1996 | [a=1][b=a] 1997 | [a=1][b=a] 1998 | [a=2][b=a] 1999 | [a=3][b=a] 2000 | [a=4][b=a] 2001 | [a=4][b=a] 2002 | [a=4][b=a] 2003 | [a=4][b=b] 2004 | [a=3][b=b] 2005 | [a=3][b=b] 2006 | [a=3][b=b] 2007 | [a=4][b=b] 2008 | [a=4][b=b] 2009 | [a=5][b=b] 2010 | 2011 | [a=1][b=a] 2012 | [a=1][b=a] 2013 | [a=2][b=a] 2014 | [a=3][b=a] 2015 | [a=4][b=a] 2016 | [a=4][b=a] 2017 | [a=4][b=a] 2018 | [a=4][b=b] 2019 | [a=3][b=b] 2020 | [a=3][b=b] 2021 | [a=3][b=b] 2022 | [a=4][b=b] 2023 | [a=4][b=b] 2024 | [a=5][b=b] 2025 | 2026 | [a=1][b=a] 2027 | [a=1][b=a] 2028 | [a=2][b=a] 2029 | [a=3][b=a] 2030 | [a=4][b=a] 2031 | [a=4][b=a] 2032 | [a=4][b=a] 2033 | [a=4][b=b] 2034 | [a=3][b=b] 2035 | [a=3][b=b] 2036 | [a=3][b=b] 2037 | [a=4][b=b] 2038 | [a=4][b=b] 2039 | [a=5][b=b] 2040 | 2041 | [a=1][b=a] 2042 | [a=1][b=a] 2043 | [a=2][b=a] 2044 | [a=3][b=a] 2045 | [a=4][b=a] 2046 | [a=4][b=a] 2047 | [a=4][b=a] 2048 | [a=4][b=b] 2049 | [a=3][b=b] 2050 | [a=3][b=b] 2051 | [a=3][b=b] 2052 | [a=4][b=b] 2053 | [a=4][b=b] 2054 | [a=5][b=b] 2055 | 2056 | [a=1][b=a] 2057 | [a=1][b=a] 2058 | [a=2][b=a] 2059 | [a=3][b=a] 2060 | [a=4][b=a] 2061 | [a=4][b=a] 2062 | [a=4][b=a] 2063 | [a=4][b=b] 2064 | [a=3][b=b] 2065 | [a=3][b=b] 2066 | [a=3][b=b] 2067 | [a=4][b=b] 2068 | [a=4][b=b] 2069 | [a=5][b=b] 2070 | 2071 | [a=1][b=a] 2072 | [a=1][b=a] 2073 | [a=2][b=a] 2074 | [a=3][b=a] 2075 | [a=4][b=a] 2076 | [a=4][b=a] 2077 | [a=4][b=a] 2078 | [a=4][b=b] 2079 | [a=3][b=b] 2080 | [a=3][b=b] 2081 | [a=3][b=b] 2082 | [a=4][b=b] 2083 | [a=4][b=b] 2084 | [a=5][b=b] 2085 | 2086 | [a=1][b=a] 2087 | [a=1][b=a] 2088 | [a=2][b=a] 2089 | [a=3][b=a] 2090 | [a=4][b=a] 2091 | [a=4][b=a] 2092 | [a=4][b=a] 2093 | [a=4][b=b] 2094 | [a=3][b=b] 2095 | [a=3][b=b] 2096 | [a=3][b=b] 2097 | [a=4][b=b] 2098 | [a=4][b=b] 2099 | [a=5][b=b] 2100 | 2101 | [a=1][b=a] 2102 | [a=1][b=a] 2103 | [a=2][b=a] 2104 | [a=3][b=a] 2105 | [a=4][b=a] 2106 | [a=4][b=a] 2107 | [a=4][b=a] 2108 | [a=4][b=b] 2109 | [a=3][b=b] 2110 | [a=3][b=b] 2111 | [a=3][b=b] 2112 | [a=4][b=b] 2113 | [a=4][b=b] 2114 | [a=5][b=b] 2115 | 2116 | [a=1][b=a] 2117 | [a=1][b=a] 2118 | [a=2][b=a] 2119 | [a=3][b=a] 2120 | [a=4][b=a] 2121 | [a=4][b=a] 2122 | [a=4][b=a] 2123 | [a=4][b=b] 2124 | [a=3][b=b] 2125 | [a=3][b=b] 2126 | [a=3][b=b] 2127 | [a=4][b=b] 2128 | [a=4][b=b] 2129 | [a=5][b=b] 2130 | 2131 | [a=1][b=a] 2132 | [a=1][b=a] 2133 | [a=2][b=a] 2134 | [a=3][b=a] 2135 | [a=4][b=a] 2136 | [a=4][b=a] 2137 | [a=4][b=a] 2138 | [a=4][b=b] 2139 | [a=3][b=b] 2140 | [a=3][b=b] 2141 | [a=3][b=b] 2142 | [a=4][b=b] 2143 | [a=4][b=b] 2144 | [a=5][b=b] 2145 | 2146 | [a=1][b=a] 2147 | [a=1][b=a] 2148 | [a=2][b=a] 2149 | [a=3][b=a] 2150 | [a=4][b=a] 2151 | [a=4][b=a] 2152 | [a=4][b=a] 2153 | [a=4][b=b] 2154 | [a=3][b=b] 2155 | [a=3][b=b] 2156 | [a=3][b=b] 2157 | [a=4][b=b] 2158 | [a=4][b=b] 2159 | [a=5][b=b] 2160 | 2161 | [a=1][b=a] 2162 | [a=1][b=a] 2163 | [a=2][b=a] 2164 | [a=3][b=a] 2165 | [a=4][b=a] 2166 | [a=4][b=a] 2167 | [a=4][b=a] 2168 | [a=4][b=b] 2169 | [a=3][b=b] 2170 | [a=3][b=b] 2171 | [a=3][b=b] 2172 | [a=4][b=b] 2173 | [a=4][b=b] 2174 | [a=5][b=b] 2175 | 2176 | [a=1][b=a] 2177 | [a=1][b=a] 2178 | [a=2][b=a] 2179 | [a=3][b=a] 2180 | [a=4][b=a] 2181 | [a=4][b=a] 2182 | [a=4][b=a] 2183 | [a=4][b=b] 2184 | [a=3][b=b] 2185 | [a=3][b=b] 2186 | [a=3][b=b] 2187 | [a=4][b=b] 2188 | [a=4][b=b] 2189 | [a=5][b=b] 2190 | 2191 | [a=1][b=a] 2192 | [a=1][b=a] 2193 | [a=2][b=a] 2194 | [a=3][b=a] 2195 | [a=4][b=a] 2196 | [a=4][b=a] 2197 | [a=4][b=a] 2198 | [a=4][b=b] 2199 | [a=3][b=b] 2200 | [a=3][b=b] 2201 | [a=3][b=b] 2202 | [a=4][b=b] 2203 | [a=4][b=b] 2204 | [a=5][b=b] 2205 | 2206 | [a=1][b=a] 2207 | [a=1][b=a] 2208 | [a=2][b=a] 2209 | [a=3][b=a] 2210 | [a=4][b=a] 2211 | [a=4][b=a] 2212 | [a=4][b=a] 2213 | [a=4][b=b] 2214 | [a=3][b=b] 2215 | [a=3][b=b] 2216 | [a=3][b=b] 2217 | [a=4][b=b] 2218 | [a=4][b=b] 2219 | [a=5][b=b] 2220 | 2221 | [a=1][b=a] 2222 | [a=1][b=a] 2223 | [a=2][b=a] 2224 | [a=3][b=a] 2225 | [a=4][b=a] 2226 | [a=4][b=a] 2227 | [a=4][b=a] 2228 | [a=4][b=b] 2229 | [a=3][b=b] 2230 | [a=3][b=b] 2231 | [a=3][b=b] 2232 | [a=4][b=b] 2233 | [a=4][b=b] 2234 | [a=5][b=b] 2235 | 2236 | [a=1][b=a] 2237 | [a=1][b=a] 2238 | [a=2][b=a] 2239 | [a=3][b=a] 2240 | [a=4][b=a] 2241 | [a=4][b=a] 2242 | [a=4][b=a] 2243 | [a=4][b=b] 2244 | [a=3][b=b] 2245 | [a=3][b=b] 2246 | [a=3][b=b] 2247 | [a=4][b=b] 2248 | [a=4][b=b] 2249 | [a=5][b=b] 2250 | 2251 | [a=1][b=a] 2252 | [a=1][b=a] 2253 | [a=2][b=a] 2254 | [a=3][b=a] 2255 | [a=4][b=a] 2256 | [a=4][b=a] 2257 | [a=4][b=a] 2258 | [a=4][b=b] 2259 | [a=3][b=b] 2260 | [a=3][b=b] 2261 | [a=3][b=b] 2262 | [a=4][b=b] 2263 | [a=4][b=b] 2264 | [a=5][b=b] 2265 | 2266 | [a=1][b=a] 2267 | [a=1][b=a] 2268 | [a=2][b=a] 2269 | [a=3][b=a] 2270 | [a=4][b=a] 2271 | [a=4][b=a] 2272 | [a=4][b=a] 2273 | [a=4][b=b] 2274 | [a=3][b=b] 2275 | [a=3][b=b] 2276 | [a=3][b=b] 2277 | [a=4][b=b] 2278 | [a=4][b=b] 2279 | [a=5][b=b] 2280 | 2281 | [a=1][b=a] 2282 | [a=1][b=a] 2283 | [a=2][b=a] 2284 | [a=3][b=a] 2285 | [a=4][b=a] 2286 | [a=4][b=a] 2287 | [a=4][b=a] 2288 | [a=4][b=b] 2289 | [a=3][b=b] 2290 | [a=3][b=b] 2291 | [a=3][b=b] 2292 | [a=4][b=b] 2293 | [a=4][b=b] 2294 | [a=5][b=b] 2295 | 2296 | [a=1][b=a] 2297 | [a=1][b=a] 2298 | [a=2][b=a] 2299 | [a=3][b=a] 2300 | [a=4][b=a] 2301 | [a=4][b=a] 2302 | [a=4][b=a] 2303 | [a=4][b=b] 2304 | [a=3][b=b] 2305 | [a=3][b=b] 2306 | [a=3][b=b] 2307 | [a=4][b=b] 2308 | [a=4][b=b] 2309 | [a=5][b=b] 2310 | 2311 | [a=1][b=a] 2312 | [a=1][b=a] 2313 | [a=2][b=a] 2314 | [a=3][b=a] 2315 | [a=4][b=a] 2316 | [a=4][b=a] 2317 | [a=4][b=a] 2318 | [a=4][b=b] 2319 | [a=3][b=b] 2320 | [a=3][b=b] 2321 | [a=3][b=b] 2322 | [a=4][b=b] 2323 | [a=4][b=b] 2324 | [a=5][b=b] 2325 | 2326 | [a=1][b=a] 2327 | [a=1][b=a] 2328 | [a=2][b=a] 2329 | [a=3][b=a] 2330 | [a=4][b=a] 2331 | [a=4][b=a] 2332 | [a=4][b=a] 2333 | [a=4][b=b] 2334 | [a=3][b=b] 2335 | [a=3][b=b] 2336 | [a=3][b=b] 2337 | [a=4][b=b] 2338 | [a=4][b=b] 2339 | [a=5][b=b] 2340 | 2341 | [a=1][b=a] 2342 | [a=1][b=a] 2343 | [a=2][b=a] 2344 | [a=3][b=a] 2345 | [a=4][b=a] 2346 | [a=4][b=a] 2347 | [a=4][b=a] 2348 | [a=4][b=b] 2349 | [a=3][b=b] 2350 | [a=3][b=b] 2351 | [a=3][b=b] 2352 | [a=4][b=b] 2353 | [a=4][b=b] 2354 | [a=5][b=b] 2355 | 2356 | [a=1][b=a] 2357 | [a=1][b=a] 2358 | [a=2][b=a] 2359 | [a=3][b=a] 2360 | [a=4][b=a] 2361 | [a=4][b=a] 2362 | [a=4][b=a] 2363 | [a=4][b=b] 2364 | [a=3][b=b] 2365 | [a=3][b=b] 2366 | [a=3][b=b] 2367 | [a=4][b=b] 2368 | [a=4][b=b] 2369 | [a=5][b=b] 2370 | 2371 | [a=1][b=a] 2372 | [a=1][b=a] 2373 | [a=2][b=a] 2374 | [a=3][b=a] 2375 | [a=4][b=a] 2376 | [a=4][b=a] 2377 | [a=4][b=a] 2378 | [a=4][b=b] 2379 | [a=3][b=b] 2380 | [a=3][b=b] 2381 | [a=3][b=b] 2382 | [a=4][b=b] 2383 | [a=4][b=b] 2384 | [a=5][b=b] 2385 | 2386 | [a=1][b=a] 2387 | [a=1][b=a] 2388 | [a=2][b=a] 2389 | [a=3][b=a] 2390 | [a=4][b=a] 2391 | [a=4][b=a] 2392 | [a=4][b=a] 2393 | [a=4][b=b] 2394 | [a=3][b=b] 2395 | [a=3][b=b] 2396 | [a=3][b=b] 2397 | [a=4][b=b] 2398 | [a=4][b=b] 2399 | [a=5][b=b] 2400 | 2401 | [a=1][b=a] 2402 | [a=1][b=a] 2403 | [a=2][b=a] 2404 | [a=3][b=a] 2405 | [a=4][b=a] 2406 | [a=4][b=a] 2407 | [a=4][b=a] 2408 | [a=4][b=b] 2409 | [a=3][b=b] 2410 | [a=3][b=b] 2411 | [a=3][b=b] 2412 | [a=4][b=b] 2413 | [a=4][b=b] 2414 | [a=5][b=b] 2415 | 2416 | [a=1][b=a] 2417 | [a=1][b=a] 2418 | [a=2][b=a] 2419 | [a=3][b=a] 2420 | [a=4][b=a] 2421 | [a=4][b=a] 2422 | [a=4][b=a] 2423 | [a=4][b=b] 2424 | [a=3][b=b] 2425 | [a=3][b=b] 2426 | [a=3][b=b] 2427 | [a=4][b=b] 2428 | [a=4][b=b] 2429 | [a=5][b=b] 2430 | 2431 | [a=1][b=a] 2432 | [a=1][b=a] 2433 | [a=2][b=a] 2434 | [a=3][b=a] 2435 | [a=4][b=a] 2436 | [a=4][b=a] 2437 | [a=4][b=a] 2438 | [a=4][b=b] 2439 | [a=3][b=b] 2440 | [a=3][b=b] 2441 | [a=3][b=b] 2442 | [a=4][b=b] 2443 | [a=4][b=b] 2444 | [a=5][b=b] 2445 | 2446 | [a=1][b=a] 2447 | [a=1][b=a] 2448 | [a=2][b=a] 2449 | [a=3][b=a] 2450 | [a=4][b=a] 2451 | [a=4][b=a] 2452 | [a=4][b=a] 2453 | [a=4][b=b] 2454 | [a=3][b=b] 2455 | [a=3][b=b] 2456 | [a=3][b=b] 2457 | [a=4][b=b] 2458 | [a=4][b=b] 2459 | [a=5][b=b] 2460 | 2461 | [a=1][b=a] 2462 | [a=1][b=a] 2463 | [a=2][b=a] 2464 | [a=3][b=a] 2465 | [a=4][b=a] 2466 | [a=4][b=a] 2467 | [a=4][b=a] 2468 | [a=4][b=b] 2469 | [a=3][b=b] 2470 | [a=3][b=b] 2471 | [a=3][b=b] 2472 | [a=4][b=b] 2473 | [a=4][b=b] 2474 | [a=5][b=b] 2475 | 2476 | [a=1][b=a] 2477 | [a=1][b=a] 2478 | [a=2][b=a] 2479 | [a=3][b=a] 2480 | [a=4][b=a] 2481 | [a=4][b=a] 2482 | [a=4][b=a] 2483 | [a=4][b=b] 2484 | [a=3][b=b] 2485 | [a=3][b=b] 2486 | [a=3][b=b] 2487 | [a=4][b=b] 2488 | [a=4][b=b] 2489 | [a=5][b=b] 2490 | 2491 | [a=1][b=a] 2492 | [a=1][b=a] 2493 | [a=2][b=a] 2494 | [a=3][b=a] 2495 | [a=4][b=a] 2496 | [a=4][b=a] 2497 | [a=4][b=a] 2498 | [a=4][b=b] 2499 | [a=3][b=b] 2500 | [a=3][b=b] 2501 | [a=3][b=b] 2502 | [a=4][b=b] 2503 | [a=4][b=b] 2504 | [a=5][b=b] 2505 | 2506 | [a=1][b=a] 2507 | [a=1][b=a] 2508 | [a=2][b=a] 2509 | [a=3][b=a] 2510 | [a=4][b=a] 2511 | [a=4][b=a] 2512 | [a=4][b=a] 2513 | [a=4][b=b] 2514 | [a=3][b=b] 2515 | [a=3][b=b] 2516 | [a=3][b=b] 2517 | [a=4][b=b] 2518 | [a=4][b=b] 2519 | [a=5][b=b] 2520 | 2521 | [a=1][b=a] 2522 | [a=1][b=a] 2523 | [a=2][b=a] 2524 | [a=3][b=a] 2525 | [a=4][b=a] 2526 | [a=4][b=a] 2527 | [a=4][b=a] 2528 | [a=4][b=b] 2529 | [a=3][b=b] 2530 | [a=3][b=b] 2531 | [a=3][b=b] 2532 | [a=4][b=b] 2533 | [a=4][b=b] 2534 | [a=5][b=b] 2535 | 2536 | [a=1][b=a] 2537 | [a=1][b=a] 2538 | [a=2][b=a] 2539 | [a=3][b=a] 2540 | [a=4][b=a] 2541 | [a=4][b=a] 2542 | [a=4][b=a] 2543 | [a=4][b=b] 2544 | [a=3][b=b] 2545 | [a=3][b=b] 2546 | [a=3][b=b] 2547 | [a=4][b=b] 2548 | [a=4][b=b] 2549 | [a=5][b=b] 2550 | 2551 | [a=1][b=a] 2552 | [a=1][b=a] 2553 | [a=2][b=a] 2554 | [a=3][b=a] 2555 | [a=4][b=a] 2556 | [a=4][b=a] 2557 | [a=4][b=a] 2558 | [a=4][b=b] 2559 | [a=3][b=b] 2560 | [a=3][b=b] 2561 | [a=3][b=b] 2562 | [a=4][b=b] 2563 | [a=4][b=b] 2564 | [a=5][b=b] 2565 | 2566 | [a=1][b=a] 2567 | [a=1][b=a] 2568 | [a=2][b=a] 2569 | [a=3][b=a] 2570 | [a=4][b=a] 2571 | [a=4][b=a] 2572 | [a=4][b=a] 2573 | [a=4][b=b] 2574 | [a=3][b=b] 2575 | [a=3][b=b] 2576 | [a=3][b=b] 2577 | [a=4][b=b] 2578 | [a=4][b=b] 2579 | [a=5][b=b] 2580 | 2581 | [a=1][b=a] 2582 | [a=1][b=a] 2583 | [a=2][b=a] 2584 | [a=3][b=a] 2585 | [a=4][b=a] 2586 | [a=4][b=a] 2587 | [a=4][b=a] 2588 | [a=4][b=b] 2589 | [a=3][b=b] 2590 | [a=3][b=b] 2591 | [a=3][b=b] 2592 | [a=4][b=b] 2593 | [a=4][b=b] 2594 | [a=5][b=b] 2595 | 2596 | [a=1][b=a] 2597 | [a=1][b=a] 2598 | [a=2][b=a] 2599 | [a=3][b=a] 2600 | [a=4][b=a] 2601 | [a=4][b=a] 2602 | [a=4][b=a] 2603 | [a=4][b=b] 2604 | [a=3][b=b] 2605 | [a=3][b=b] 2606 | [a=3][b=b] 2607 | [a=4][b=b] 2608 | [a=4][b=b] 2609 | [a=5][b=b] 2610 | 2611 | [a=1][b=a] 2612 | [a=1][b=a] 2613 | [a=2][b=a] 2614 | [a=3][b=a] 2615 | [a=4][b=a] 2616 | [a=4][b=a] 2617 | [a=4][b=a] 2618 | [a=4][b=b] 2619 | [a=3][b=b] 2620 | [a=3][b=b] 2621 | [a=3][b=b] 2622 | [a=4][b=b] 2623 | [a=4][b=b] 2624 | [a=5][b=b] 2625 | 2626 | [a=1][b=a] 2627 | [a=1][b=a] 2628 | [a=2][b=a] 2629 | [a=3][b=a] 2630 | [a=4][b=a] 2631 | [a=4][b=a] 2632 | [a=4][b=a] 2633 | [a=4][b=b] 2634 | [a=3][b=b] 2635 | [a=3][b=b] 2636 | [a=3][b=b] 2637 | [a=4][b=b] 2638 | [a=4][b=b] 2639 | [a=5][b=b] 2640 | 2641 | [a=1][b=a] 2642 | [a=1][b=a] 2643 | [a=2][b=a] 2644 | [a=3][b=a] 2645 | [a=4][b=a] 2646 | [a=4][b=a] 2647 | [a=4][b=a] 2648 | [a=4][b=b] 2649 | [a=3][b=b] 2650 | [a=3][b=b] 2651 | [a=3][b=b] 2652 | [a=4][b=b] 2653 | [a=4][b=b] 2654 | [a=5][b=b] 2655 | 2656 | [a=1][b=a] 2657 | [a=1][b=a] 2658 | [a=2][b=a] 2659 | [a=3][b=a] 2660 | [a=4][b=a] 2661 | [a=4][b=a] 2662 | [a=4][b=a] 2663 | [a=4][b=b] 2664 | [a=3][b=b] 2665 | [a=3][b=b] 2666 | [a=3][b=b] 2667 | [a=4][b=b] 2668 | [a=4][b=b] 2669 | [a=5][b=b] 2670 | 2671 | [a=1][b=a] 2672 | [a=1][b=a] 2673 | [a=2][b=a] 2674 | [a=3][b=a] 2675 | [a=4][b=a] 2676 | [a=4][b=a] 2677 | [a=4][b=a] 2678 | [a=4][b=b] 2679 | [a=3][b=b] 2680 | [a=3][b=b] 2681 | [a=3][b=b] 2682 | [a=4][b=b] 2683 | [a=4][b=b] 2684 | [a=5][b=b] 2685 | 2686 | [a=1][b=a] 2687 | [a=1][b=a] 2688 | [a=2][b=a] 2689 | [a=3][b=a] 2690 | [a=4][b=a] 2691 | [a=4][b=a] 2692 | [a=4][b=a] 2693 | [a=4][b=b] 2694 | [a=3][b=b] 2695 | [a=3][b=b] 2696 | [a=3][b=b] 2697 | [a=4][b=b] 2698 | [a=4][b=b] 2699 | [a=5][b=b] 2700 | 2701 | [a=1][b=a] 2702 | [a=1][b=a] 2703 | [a=2][b=a] 2704 | [a=3][b=a] 2705 | [a=4][b=a] 2706 | [a=4][b=a] 2707 | [a=4][b=a] 2708 | [a=4][b=b] 2709 | [a=3][b=b] 2710 | [a=3][b=b] 2711 | [a=3][b=b] 2712 | [a=4][b=b] 2713 | [a=4][b=b] 2714 | [a=5][b=b] 2715 | 2716 | [a=1][b=a] 2717 | [a=1][b=a] 2718 | [a=2][b=a] 2719 | [a=3][b=a] 2720 | [a=4][b=a] 2721 | [a=4][b=a] 2722 | [a=4][b=a] 2723 | [a=4][b=b] 2724 | [a=3][b=b] 2725 | [a=3][b=b] 2726 | [a=3][b=b] 2727 | [a=4][b=b] 2728 | [a=4][b=b] 2729 | [a=5][b=b] 2730 | 2731 | [a=1][b=a] 2732 | [a=1][b=a] 2733 | [a=2][b=a] 2734 | [a=3][b=a] 2735 | [a=4][b=a] 2736 | [a=4][b=a] 2737 | [a=4][b=a] 2738 | [a=4][b=b] 2739 | [a=3][b=b] 2740 | [a=3][b=b] 2741 | [a=3][b=b] 2742 | [a=4][b=b] 2743 | [a=4][b=b] 2744 | [a=5][b=b] 2745 | 2746 | [a=1][b=a] 2747 | [a=1][b=a] 2748 | [a=2][b=a] 2749 | [a=3][b=a] 2750 | [a=4][b=a] 2751 | [a=4][b=a] 2752 | [a=4][b=a] 2753 | [a=4][b=b] 2754 | [a=3][b=b] 2755 | [a=3][b=b] 2756 | [a=3][b=b] 2757 | [a=4][b=b] 2758 | [a=4][b=b] 2759 | [a=5][b=b] 2760 | 2761 | [a=1][b=a] 2762 | [a=1][b=a] 2763 | [a=2][b=a] 2764 | [a=3][b=a] 2765 | [a=4][b=a] 2766 | [a=4][b=a] 2767 | [a=4][b=a] 2768 | [a=4][b=b] 2769 | [a=3][b=b] 2770 | [a=3][b=b] 2771 | [a=3][b=b] 2772 | [a=4][b=b] 2773 | [a=4][b=b] 2774 | [a=5][b=b] 2775 | 2776 | [a=1][b=a] 2777 | [a=1][b=a] 2778 | [a=2][b=a] 2779 | [a=3][b=a] 2780 | [a=4][b=a] 2781 | [a=4][b=a] 2782 | [a=4][b=a] 2783 | [a=4][b=b] 2784 | [a=3][b=b] 2785 | [a=3][b=b] 2786 | [a=3][b=b] 2787 | [a=4][b=b] 2788 | [a=4][b=b] 2789 | [a=5][b=b] 2790 | 2791 | [a=1][b=a] 2792 | [a=1][b=a] 2793 | [a=2][b=a] 2794 | [a=3][b=a] 2795 | [a=4][b=a] 2796 | [a=4][b=a] 2797 | [a=4][b=a] 2798 | [a=4][b=b] 2799 | [a=3][b=b] 2800 | [a=3][b=b] 2801 | [a=3][b=b] 2802 | [a=4][b=b] 2803 | [a=4][b=b] 2804 | [a=5][b=b] 2805 | 2806 | [a=1][b=a] 2807 | [a=1][b=a] 2808 | [a=2][b=a] 2809 | [a=3][b=a] 2810 | [a=4][b=a] 2811 | [a=4][b=a] 2812 | [a=4][b=a] 2813 | [a=4][b=b] 2814 | [a=3][b=b] 2815 | [a=3][b=b] 2816 | [a=3][b=b] 2817 | [a=4][b=b] 2818 | [a=4][b=b] 2819 | [a=5][b=b] 2820 | 2821 | [a=1][b=a] 2822 | [a=1][b=a] 2823 | [a=2][b=a] 2824 | [a=3][b=a] 2825 | [a=4][b=a] 2826 | [a=4][b=a] 2827 | [a=4][b=a] 2828 | [a=4][b=b] 2829 | [a=3][b=b] 2830 | [a=3][b=b] 2831 | [a=3][b=b] 2832 | [a=4][b=b] 2833 | [a=4][b=b] 2834 | [a=5][b=b] 2835 | 2836 | [a=1][b=a] 2837 | [a=1][b=a] 2838 | [a=2][b=a] 2839 | [a=3][b=a] 2840 | [a=4][b=a] 2841 | [a=4][b=a] 2842 | [a=4][b=a] 2843 | [a=4][b=b] 2844 | [a=3][b=b] 2845 | [a=3][b=b] 2846 | [a=3][b=b] 2847 | [a=4][b=b] 2848 | [a=4][b=b] 2849 | [a=5][b=b] 2850 | 2851 | [a=1][b=a] 2852 | [a=1][b=a] 2853 | [a=2][b=a] 2854 | [a=3][b=a] 2855 | [a=4][b=a] 2856 | [a=4][b=a] 2857 | [a=4][b=a] 2858 | [a=4][b=b] 2859 | [a=3][b=b] 2860 | [a=3][b=b] 2861 | [a=3][b=b] 2862 | [a=4][b=b] 2863 | [a=4][b=b] 2864 | [a=5][b=b] 2865 | 2866 | [a=1][b=a] 2867 | [a=1][b=a] 2868 | [a=2][b=a] 2869 | [a=3][b=a] 2870 | [a=4][b=a] 2871 | [a=4][b=a] 2872 | [a=4][b=a] 2873 | [a=4][b=b] 2874 | [a=3][b=b] 2875 | [a=3][b=b] 2876 | [a=3][b=b] 2877 | [a=4][b=b] 2878 | [a=4][b=b] 2879 | [a=5][b=b] 2880 | 2881 | [a=1][b=a] 2882 | [a=1][b=a] 2883 | [a=2][b=a] 2884 | [a=3][b=a] 2885 | [a=4][b=a] 2886 | [a=4][b=a] 2887 | [a=4][b=a] 2888 | [a=4][b=b] 2889 | [a=3][b=b] 2890 | [a=3][b=b] 2891 | [a=3][b=b] 2892 | [a=4][b=b] 2893 | [a=4][b=b] 2894 | [a=5][b=b] 2895 | 2896 | [a=1][b=a] 2897 | [a=1][b=a] 2898 | [a=2][b=a] 2899 | [a=3][b=a] 2900 | [a=4][b=a] 2901 | [a=4][b=a] 2902 | [a=4][b=a] 2903 | [a=4][b=b] 2904 | [a=3][b=b] 2905 | [a=3][b=b] 2906 | [a=3][b=b] 2907 | [a=4][b=b] 2908 | [a=4][b=b] 2909 | [a=5][b=b] 2910 | 2911 | [a=1][b=a] 2912 | [a=1][b=a] 2913 | [a=2][b=a] 2914 | [a=3][b=a] 2915 | [a=4][b=a] 2916 | [a=4][b=a] 2917 | [a=4][b=a] 2918 | [a=4][b=b] 2919 | [a=3][b=b] 2920 | [a=3][b=b] 2921 | [a=3][b=b] 2922 | [a=4][b=b] 2923 | [a=4][b=b] 2924 | [a=5][b=b] 2925 | 2926 | [a=1][b=a] 2927 | [a=1][b=a] 2928 | [a=2][b=a] 2929 | [a=3][b=a] 2930 | [a=4][b=a] 2931 | [a=4][b=a] 2932 | [a=4][b=a] 2933 | [a=4][b=b] 2934 | [a=3][b=b] 2935 | [a=3][b=b] 2936 | [a=3][b=b] 2937 | [a=4][b=b] 2938 | [a=4][b=b] 2939 | [a=5][b=b] 2940 | 2941 | [a=1][b=a] 2942 | [a=1][b=a] 2943 | [a=2][b=a] 2944 | [a=3][b=a] 2945 | [a=4][b=a] 2946 | [a=4][b=a] 2947 | [a=4][b=a] 2948 | [a=4][b=b] 2949 | [a=3][b=b] 2950 | [a=3][b=b] 2951 | [a=3][b=b] 2952 | [a=4][b=b] 2953 | [a=4][b=b] 2954 | [a=5][b=b] 2955 | 2956 | [a=1][b=a] 2957 | [a=1][b=a] 2958 | [a=2][b=a] 2959 | [a=3][b=a] 2960 | [a=4][b=a] 2961 | [a=4][b=a] 2962 | [a=4][b=a] 2963 | [a=4][b=b] 2964 | [a=3][b=b] 2965 | [a=3][b=b] 2966 | [a=3][b=b] 2967 | [a=4][b=b] 2968 | [a=4][b=b] 2969 | [a=5][b=b] 2970 | 2971 | [a=1][b=a] 2972 | [a=1][b=a] 2973 | [a=2][b=a] 2974 | [a=3][b=a] 2975 | [a=4][b=a] 2976 | [a=4][b=a] 2977 | [a=4][b=a] 2978 | [a=4][b=b] 2979 | [a=3][b=b] 2980 | [a=3][b=b] 2981 | [a=3][b=b] 2982 | [a=4][b=b] 2983 | [a=4][b=b] 2984 | [a=5][b=b] 2985 | 2986 | [a=1][b=a] 2987 | [a=1][b=a] 2988 | [a=2][b=a] 2989 | [a=3][b=a] 2990 | [a=4][b=a] 2991 | [a=4][b=a] 2992 | [a=4][b=a] 2993 | [a=4][b=b] 2994 | [a=3][b=b] 2995 | [a=3][b=b] 2996 | [a=3][b=b] 2997 | [a=4][b=b] 2998 | [a=4][b=b] 2999 | [a=5][b=b] 3000 | 3001 | [a=1][b=a] 3002 | [a=1][b=a] 3003 | [a=2][b=a] 3004 | [a=3][b=a] 3005 | [a=4][b=a] 3006 | [a=4][b=a] 3007 | [a=4][b=a] 3008 | [a=4][b=b] 3009 | [a=3][b=b] 3010 | [a=3][b=b] 3011 | [a=3][b=b] 3012 | [a=4][b=b] 3013 | [a=4][b=b] 3014 | [a=5][b=b] 3015 | 3016 | -------------------------------------------------------------------------------- /example/test1: -------------------------------------------------------------------------------- 1 | [a=b] 2 | [a=b] 3 | [a=c] 4 | [a=d] 5 | -------------------------------------------------------------------------------- /example/test2: -------------------------------------------------------------------------------- 1 | [a=1][b=a] 2 | [a=1][b=a] 3 | [a=2][b=a] 4 | [a=3][b=a] 5 | [a=4][b=a] 6 | [a=4][b=a] 7 | [a=4][b=a] 8 | [a=4][b=b] 9 | [a=3][b=b] 10 | [a=3][b=b] 11 | [a=3][b=b] 12 | [a=4][b=b] 13 | [a=4][b=b] 14 | [a=5][b=b] 15 | -------------------------------------------------------------------------------- /expr/Expr.go: -------------------------------------------------------------------------------- 1 | package expr 2 | 3 | import ( 4 | "fmt" 5 | "github.com/SumoLogic/sumoshell/util" 6 | "os/exec" 7 | "strings" 8 | ) 9 | 10 | type ExprOperator struct { 11 | lsh string 12 | expr string 13 | output *util.JsonWriter 14 | } 15 | 16 | const genericError = "expr takes arguments like: newV = 5 + 5 * x" 17 | 18 | func Build(args []string) (util.SumoOperator, error) { 19 | 20 | lsh := args[1] 21 | eq := args[2] 22 | if eq != "=" { 23 | return nil, util.ParseError("Expected `=` found `" + eq + "`\n" + genericError) 24 | } 25 | value := strings.Join(args[3:], " ") 26 | 27 | return &ExprOperator{lsh, value, util.NewJsonWriter()}, nil 28 | } 29 | 30 | func (w ExprOperator) Process(inp map[string]interface{}) { 31 | if util.IsPlus(inp) { 32 | vars := []string{} 33 | for k, v := range inp { 34 | _, isNumber := util.CoerceNumber(v) 35 | var s string 36 | if isNumber == nil { 37 | s = fmt.Sprintf("%v=%v", k, v) 38 | } else { 39 | s = fmt.Sprintf("%v=\"%v\"", k, v) 40 | } 41 | vars = append(vars, s) 42 | } 43 | varStr := strings.Join(vars, ";") 44 | pythonCmd := varStr + "; print " + w.expr 45 | cmdStr := []string{"-c", pythonCmd} 46 | cmd := exec.Command("python", cmdStr...) 47 | out, err := cmd.Output() 48 | if err != nil { 49 | fmt.Println("ERROR", pythonCmd) 50 | return 51 | } 52 | strOut := strings.Trim(string(out), "\n") 53 | numRep, isNum := util.CoerceNumber(strOut) 54 | if isNum == nil { 55 | inp[w.lsh] = numRep 56 | } else { 57 | inp[w.lsh] = strOut 58 | } 59 | w.output.Write(inp) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /filter/Filter.go: -------------------------------------------------------------------------------- 1 | package filter 2 | 3 | import ( 4 | "github.com/SumoLogic/sumoshell/util" 5 | ) 6 | 7 | type FilterOperator struct { 8 | key string 9 | value string 10 | output *util.JsonWriter 11 | } 12 | 13 | const genericError = "filter takes arguments like: `filter x = y`" 14 | 15 | func Build(args []string) (util.SumoOperator, error) { 16 | if len(args) < 4 { 17 | return nil, util.ParseError("Error! Not enough arguments provided.\n" + genericError) 18 | } 19 | 20 | key := args[1] 21 | eq := args[2] 22 | if eq != "=" { 23 | return nil, util.ParseError("Expected `=` found `" + eq + "`\n" + genericError) 24 | } 25 | value := args[3] 26 | 27 | return &FilterOperator{key, value, util.NewJsonWriter()}, nil 28 | } 29 | 30 | func (w FilterOperator) Process(inp map[string]interface{}) { 31 | if util.IsPlus(inp) { 32 | v, exists := inp[w.key] 33 | if exists && v == w.value { 34 | w.output.Write(inp) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /graph/Graph.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | package main 5 | 6 | import ( 7 | "fmt" 8 | "github.com/SumoLogic/sumoshell/render-util" 9 | ui "gopkg.in/gizak/termui.v1" 10 | "strconv" 11 | ) 12 | 13 | func main() { 14 | flush := func() error { return nil } 15 | renderState := render.NewConnectedRenderState(flush) 16 | createUi(renderState) 17 | } 18 | 19 | func createUi(state *render.RenderState) { 20 | err := ui.Init() 21 | if err != nil { 22 | panic(err) 23 | } 24 | defer ui.Close() 25 | ui.UseTheme("helloworld") 26 | 27 | bc := ui.NewBarChart() 28 | data := []int{} 29 | bclabels := []string{} 30 | bc.Border.Label = "SumoCLI" 31 | bc.Data = data 32 | //bc.Width = 26 33 | bc.Height = ui.TermHeight() - 10 34 | bc.DataLabels = bclabels 35 | bc.TextColor = ui.ColorGreen 36 | bc.BarColor = ui.ColorRed 37 | bc.NumColor = ui.ColorYellow 38 | 39 | // build layout 40 | ui.Body.AddRows( 41 | ui.NewRow( 42 | ui.NewCol(12, 0, bc))) 43 | 44 | // calculate layout 45 | ui.Body.Align() 46 | 47 | done := make(chan bool) 48 | redraw := make(chan bool) 49 | 50 | update := func() error { 51 | //fmt.Println("updating") 52 | bars := render.Columns(*state.Messages) 53 | columns := render.ColumnNames(bars) 54 | query, ok := (*state.Meta)["_queryString"] 55 | if ok && query.(string) != bc.Border.Label { 56 | bc.Border.Label = query.(string) 57 | } 58 | 59 | dataCol := render.NumericColumn(columns) 60 | data := []int{} 61 | labels := []string{} 62 | extractor := render.LabelExtractor(columns) 63 | for _, msg := range *state.Messages { 64 | labels = append(labels, extractor(msg)) 65 | // go is the worst 66 | floatVal, _ := strconv.ParseFloat(fmt.Sprint(msg[dataCol]), 64) 67 | rowData := int(floatVal) 68 | data = append(data, rowData) 69 | } 70 | bc.Data = data 71 | var numCols int 72 | if len(data) > 0 { 73 | numCols = len(data) 74 | } else { 75 | numCols = 1 76 | } 77 | 78 | newBarWidth := (ui.TermWidth() - 10) / numCols 79 | if int(newBarWidth) != int(bc.BarWidth) { 80 | bc.BarWidth = newBarWidth 81 | } 82 | 83 | if len(labels) != len(bc.DataLabels) { 84 | bc.DataLabels = labels 85 | } 86 | redraw <- true 87 | return nil 88 | } 89 | 90 | state.Flush = update 91 | evt := ui.EventCh() 92 | 93 | ui.Render(ui.Body) 94 | go update() 95 | 96 | for { 97 | select { 98 | case e := <-evt: 99 | if e.Type == ui.EventKey && e.Ch == 'q' { 100 | return 101 | } 102 | if e.Type == ui.EventResize { 103 | ui.Body.Width = ui.TermWidth() 104 | ui.Body.Align() 105 | go func() { redraw <- true }() 106 | } 107 | case <-done: 108 | return 109 | case <-redraw: 110 | ui.Render(ui.Body) 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /group/Grouper.go: -------------------------------------------------------------------------------- 1 | package grouper 2 | 3 | import ( 4 | "fmt" 5 | "github.com/SumoLogic/sumoshell/util" 6 | "os" 7 | "strings" 8 | "sync" 9 | ) 10 | 11 | type Grouper struct { 12 | constructor func(map[string]interface{}) util.SumoAggOperator 13 | operators map[string]util.SumoAggOperator 14 | merger Merger 15 | by []string 16 | key string 17 | mu *sync.Mutex 18 | } 19 | 20 | type builder func(Merger, string, map[string]interface{}) util.SumoAggOperator 21 | 22 | func NewAggregate( 23 | constructor builder, 24 | by []string, 25 | key string, 26 | sortCol string) Grouper { 27 | merger := NewMerger(sortCol) 28 | ctor := func(base map[string]interface{}) util.SumoAggOperator { 29 | return constructor(merger, key, base) 30 | } 31 | 32 | mu := &sync.Mutex{} 33 | return Grouper{ctor, make(map[string]util.SumoAggOperator), merger, by, key, mu} 34 | } 35 | 36 | func (g Grouper) Flush() { 37 | g.mu.Lock() 38 | defer g.mu.Unlock() 39 | for _, v := range g.operators { 40 | v.Flush() 41 | } 42 | g.merger.Flush() 43 | } 44 | 45 | func (g Grouper) Process(inp map[string]interface{}) { 46 | g.mu.Lock() 47 | defer g.mu.Unlock() 48 | var keys []string 49 | for _, key := range g.by { 50 | val, ok := inp[key] 51 | if ok { 52 | keys = append(keys, fmt.Sprint(val)) 53 | } else { 54 | keys = append(keys, "") 55 | } 56 | } 57 | 58 | groupKey := strings.Join(keys, "-") 59 | 60 | _, ok := g.operators[groupKey] 61 | if !ok { 62 | nextId := len(g.operators) 63 | base := make(map[string]interface{}) 64 | for i, key := range g.by { 65 | base[key] = keys[i] 66 | } 67 | base[Id] = nextId 68 | g.operators[groupKey] = g.constructor(base) 69 | } 70 | op, _ := g.operators[groupKey] 71 | op.Process(inp) 72 | } 73 | 74 | type Merger struct { 75 | // one map for each grouper 76 | aggregate map[int]map[string]interface{} 77 | output *util.JsonWriter 78 | mu *sync.Mutex 79 | sortCol string 80 | } 81 | 82 | func NewMerger(sortCol string) Merger { 83 | mu := &sync.Mutex{} 84 | m := Merger{make(map[int]map[string]interface{}), util.NewJsonWriter(), mu, sortCol} 85 | return m 86 | } 87 | 88 | const Id = "_Id" 89 | 90 | func ExtractId(inp map[string]interface{}) int { 91 | raw, ok := inp[Id].(int) 92 | if ok { 93 | return raw 94 | } else { 95 | return -1 96 | } 97 | } 98 | 99 | func (m Merger) Process(inp map[string]interface{}) { 100 | m.mu.Lock() 101 | defer m.mu.Unlock() 102 | if !util.IsStartRelation(inp) && !util.IsEndRelation(inp) { 103 | m.aggregate[ExtractId(inp)] = inp 104 | } 105 | } 106 | 107 | func (m Merger) Write(inp map[string]interface{}) { 108 | m.Process(inp) 109 | } 110 | 111 | func (m Merger) Flush() { 112 | m.mu.Lock() 113 | defer m.mu.Unlock() 114 | m.output.Write(util.CreateStartRelationMeta("merger")) 115 | // Output keys sorted by index so the ui is consistent 116 | if m.sortCol == "" { 117 | for i := 0; i < len(m.aggregate); i++ { 118 | m.output.Write(util.CreateRelation(m.aggregate[i])) 119 | } 120 | } else { 121 | aggs := make([]map[string]interface{}, 0, len(m.aggregate)) 122 | for i := 0; i < len(m.aggregate); i++ { 123 | aggs = append(aggs, m.aggregate[i]) 124 | } 125 | util.SortByField(m.sortCol, aggs) 126 | for i := 0; i < len(aggs); i++ { 127 | m.output.Write(util.CreateRelation(aggs[i])) 128 | 129 | } 130 | } 131 | m.output.Write(util.CreateEndRelation()) 132 | queryString := strings.Join(os.Args[0:], " ") 133 | m.output.Write(util.CreateMeta(map[string]interface{}{"_queryString": queryString})) 134 | } 135 | -------------------------------------------------------------------------------- /parse/Parse.go: -------------------------------------------------------------------------------- 1 | package parse 2 | 3 | import ( 4 | "github.com/SumoLogic/sumoshell/util" 5 | "log" 6 | "regexp" 7 | "strings" 8 | ) 9 | 10 | type Parser struct { 11 | pattern string 12 | extractions []string 13 | regex *regexp.Regexp 14 | output *util.JsonWriter 15 | } 16 | 17 | const Wildcard = '*' 18 | const genericError = "parse takes arguments like: `parse \"[key=*]\" as key`\n" 19 | 20 | func Build(args []string) (util.SumoOperator, error) { 21 | // [parse x as y, z, w] 22 | if len(args) < 2 { 23 | log.Print("Error! No arguments provided.") 24 | log.Print(genericError) 25 | return nil, util.ParseError("Error! No arguments provided\n" + genericError) 26 | } 27 | parseExpression := args[1] 28 | numExtractions := findNumExtractions(parseExpression) 29 | // (parse pattern) (as) (foo, bar, baz) 30 | expectedArgs := 2 + 1 + numExtractions 31 | if len(args) < expectedArgs { 32 | return nil, util.ParseError("Expected more arguments\n" + genericError) 33 | } 34 | as := args[2] 35 | if as != "as" { 36 | return nil, util.ParseError("Expected `as` got " + as + "\n" + genericError) 37 | } 38 | extractions := make([]string, len(args)-3) 39 | for i, arg := range args[3:] { 40 | extractions[i] = strings.Trim(arg, ",") 41 | } 42 | ret := Parser{parseExpression, extractions, regexFromPat(parseExpression), util.NewJsonWriter()} 43 | return &ret, nil 44 | } 45 | 46 | func findNumExtractions(parseExpression string) int { 47 | var count = 0 48 | for _, element := range parseExpression { 49 | if element == Wildcard { 50 | count += 1 51 | } 52 | } 53 | return count 54 | } 55 | 56 | func regexFromPat(pat string) *regexp.Regexp { 57 | regex := ".*?" + strings.Replace(regexp.QuoteMeta(pat), "\\*", "(.*?)", -1) 58 | if strings.HasSuffix(pat, "*") { 59 | regex += "$" 60 | 61 | } else { 62 | regex += ".*$" 63 | } 64 | return regexp.MustCompile(regex) 65 | } 66 | 67 | func (p Parser) Process(inp map[string]interface{}) { 68 | if util.IsPlus(inp) { 69 | matches := p.regex.FindStringSubmatch(util.ExtractRaw(inp)) 70 | if len(matches) == 1+len(p.extractions) { 71 | for i, match := range matches[1:] { 72 | inp[p.extractions[i]] = match 73 | } 74 | p.output.Write(inp) 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | rm sumoshell-linux.zip sumoshell-osx.zip 4 | 5 | rm -rf /tmp/sumoshell-tmp 6 | mkdir /tmp/sumoshell-tmp 7 | cd /tmp/sumoshell-tmp 8 | env GOOS=linux GOARCH=amd64 go build github.com/SumoLogic/sumoshell/sumo 9 | env GOOS=linux GOARCH=amd64 go build github.com/SumoLogic/sumoshell/graph 10 | env GOOS=linux GOARCH=amd64 go build github.com/SumoLogic/sumoshell/render 11 | cd - 12 | zip -rj sumoshell-linux.zip /tmp/sumoshell-tmp/* 13 | 14 | set -e 15 | rm -rf /tmp/sumoshell-tmp 16 | mkdir /tmp/sumoshell-tmp 17 | cd /tmp/sumoshell-tmp 18 | env GOOS=darwin GOARCH=amd64 go build github.com/SumoLogic/sumoshell/sumo 19 | env GOOS=darwin GOARCH=amd64 go build github.com/SumoLogic/sumoshell/graph 20 | env GOOS=darwin GOARCH=amd64 go build github.com/SumoLogic/sumoshell/render 21 | cd - 22 | zip -rj sumoshell-osx.zip /tmp/sumoshell-tmp/* 23 | -------------------------------------------------------------------------------- /render-util/RenderUtil.go: -------------------------------------------------------------------------------- 1 | package render 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | "strings" 7 | 8 | "github.com/SumoLogic/sumoshell/util" 9 | ) 10 | 11 | func uiColumn(column string) bool { 12 | if column == util.Type { 13 | return false 14 | } 15 | 16 | if column == "_raw" { 17 | return false 18 | } 19 | return true 20 | } 21 | 22 | func Columns(inp []map[string]interface{}) map[string]int { 23 | res := make(map[string]int) 24 | for _, m := range inp { 25 | for k, v := range m { 26 | if uiColumn(k) { 27 | var effectiveLength int 28 | if length(k) > length(v) { 29 | effectiveLength = length(k) 30 | } else { 31 | effectiveLength = length(v) 32 | } 33 | if res[k] < effectiveLength { 34 | res[k] = effectiveLength 35 | } 36 | } 37 | } 38 | } 39 | return res 40 | } 41 | 42 | func ColumnNames(columns map[string]int) []string { 43 | viewNames := []string{} 44 | for k, _ := range columns { 45 | viewNames = append(viewNames, k) 46 | } 47 | sort.Strings(viewNames) 48 | return viewNames 49 | } 50 | 51 | func NumericColumn(columns []string) string { 52 | for _, c := range columns { 53 | if c == "_avg" || c == "_sum" || c == "_count" { 54 | return c 55 | } 56 | } 57 | return "" 58 | } 59 | 60 | func LabelExtractor(columns []string) func(map[string]interface{}) string { 61 | labelCols := []string{} 62 | for _, c := range columns { 63 | if !strings.HasPrefix(c, "_") { 64 | labelCols = append(labelCols, c) 65 | } 66 | } 67 | return func(inp map[string]interface{}) string { 68 | res := []string{} 69 | for _, c := range labelCols { 70 | res = append(res, fmt.Sprint(inp[c])) 71 | } 72 | return strings.Join(res, "-") 73 | } 74 | } 75 | 76 | func length(inp interface{}) int { 77 | return len(Format(inp)) + 3 78 | } 79 | 80 | func Format(inp interface{}) string { 81 | return fmt.Sprintf(formatStr(inp), inp) 82 | } 83 | 84 | func formatStr(inp interface{}) string { 85 | switch v := inp.(type) { 86 | case float64: 87 | if v == float64(int64(v)) { 88 | return "%v" 89 | } 90 | return "%.2f" 91 | default: 92 | return "%v" 93 | } 94 | } 95 | 96 | type RenderState struct { 97 | Messages *[]map[string]interface{} 98 | Meta *map[string]interface{} 99 | Flush func() error 100 | } 101 | 102 | func NewConnectedRenderState(flush func() error) *RenderState { 103 | messages := make([]map[string]interface{}, 0) 104 | meta := make(map[string]interface{}) 105 | state := &RenderState{&messages, &meta, flush} 106 | go util.ConnectToStdIn(state) 107 | return state 108 | } 109 | 110 | func (state RenderState) Process(inp map[string]interface{}) { 111 | if util.IsStartRelation(inp) { 112 | newmap := make([]map[string]interface{}, 0) 113 | *state.Messages = newmap 114 | } else if util.IsEndRelation(inp) { 115 | state.Flush() 116 | } else if util.IsRelation(inp) { 117 | *state.Messages = append(*state.Messages, inp) 118 | } else if util.IsMeta(inp) { 119 | *state.Meta = inp 120 | } else if util.IsPlus(inp) { 121 | *state.Messages = append(*state.Messages, inp) 122 | state.Flush() 123 | } else { 124 | // :-( no type information 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /render/Render.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | import "github.com/SumoLogic/sumoshell/util" 5 | import "github.com/SumoLogic/sumoshell/render-util" 6 | import "strings" 7 | import "os/exec" 8 | import "os" 9 | import ( 10 | "os/signal" 11 | "strconv" 12 | "syscall" 13 | ) 14 | 15 | type Renderer struct { 16 | showRaw bool 17 | colWidths *map[string]int 18 | cols *[]string 19 | height int64 20 | width int64 21 | rowsPrinted *int64 22 | inRelation *bool 23 | limit int64 24 | } 25 | 26 | func main() { 27 | m := make(map[string]int) 28 | cols := []string{} 29 | cmd := exec.Command("stty", "size") 30 | cmd.Stdin = os.Stdout 31 | out, _ := cmd.Output() 32 | wh := strings.Split(string(out), " ") 33 | var hstr, wstr string 34 | renderAll := false 35 | if len(wh) == 1 { 36 | hstr = "9999" 37 | wstr = "9999" 38 | renderAll = true 39 | } else { 40 | wstr = strings.Trim(wh[1], "\n") 41 | hstr = strings.Trim(wh[0], "\n") 42 | } 43 | height, _ := strconv.ParseInt(hstr, 10, 64) 44 | width, _ := strconv.ParseInt(wstr, 10, 64) 45 | 46 | rows := int64(0) 47 | inRelation := false 48 | 49 | if len(os.Args) == 2 && os.Args[1] == "noraw" { 50 | util.ConnectToStdIn(Renderer{false, &m, &cols, height, width, &rows, &inRelation, 20}) 51 | } else if (len(os.Args) == 2 && os.Args[1] == "all") || renderAll { 52 | c := make(chan os.Signal, 2) 53 | 54 | // Ignore SIGTERM signals. We will stop running anyway when our input is over. 55 | // This allows us to dump the current state 56 | signal.Notify(c, os.Interrupt, syscall.SIGTERM) 57 | go func() { 58 | <-c 59 | }() 60 | rels := []map[string]interface{}{} 61 | holder := relationHolder{&rels} 62 | util.ConnectToStdIn(holder) 63 | r := Renderer{false, &m, &cols, height, width, &rows, &inRelation, -1} 64 | for _, item := range *holder.lastRelation { 65 | r.Process(item) 66 | } 67 | } else { 68 | util.ConnectToStdIn(Renderer{true, &m, &cols, height, width, &rows, &inRelation, 20}) 69 | } 70 | } 71 | 72 | type relationHolder struct { 73 | lastRelation *[]map[string]interface{} 74 | } 75 | 76 | func (r relationHolder) Process(inp map[string]interface{}) { 77 | if util.IsPlus(inp) { 78 | if len(*r.lastRelation) == 0 { 79 | slice := []map[string]interface{}{inp} 80 | *r.lastRelation = slice 81 | } else { 82 | slice := append(*r.lastRelation, inp) 83 | *r.lastRelation = slice 84 | } 85 | } 86 | if util.IsStartRelation(inp) { 87 | slice := []map[string]interface{}{inp} 88 | *r.lastRelation = slice 89 | } 90 | if util.IsRelation(inp) { 91 | slice := append(*r.lastRelation, inp) 92 | *r.lastRelation = slice 93 | } 94 | if util.IsEndRelation(inp) { 95 | slice := append(*r.lastRelation, inp) 96 | *r.lastRelation = slice 97 | } 98 | } 99 | 100 | func (r Renderer) Process(inp map[string]interface{}) { 101 | if util.IsPlus(inp) { 102 | var printed = false 103 | charsPrinted := int64(0) 104 | colsWidth := render.Columns([]map[string]interface{}{inp}) 105 | colNames := render.ColumnNames(colsWidth) 106 | *r.cols = colNames 107 | *r.colWidths = colsWidth 108 | for _, col := range colNames { 109 | v, _ := inp[col] 110 | vStr := render.Format(v) //fmt.Sprintf("%.2f", v) 111 | spaces := strings.Repeat(" ", colsWidth[col]-len(vStr)) 112 | finalStr := fmt.Sprintf("[%s=%v]%s", col, vStr, spaces) 113 | if charsPrinted+int64(len(finalStr)) > r.width { 114 | availableChars := r.width - charsPrinted 115 | if availableChars > 3 { 116 | fmt.Printf(finalStr[:availableChars-3]) 117 | fmt.Printf("...") 118 | charsPrinted = r.width 119 | } 120 | } else { 121 | charsPrinted += int64(len(finalStr)) 122 | fmt.Printf(finalStr) 123 | } 124 | } 125 | if printed { 126 | fmt.Printf(";") 127 | } 128 | if r.showRaw { 129 | fmt.Printf(util.ExtractRaw(inp)) 130 | } 131 | fmt.Print("\n") 132 | } 133 | if util.IsStartRelation(inp) { 134 | if *r.inRelation { 135 | panic("Already in relation") 136 | } 137 | *r.inRelation = true 138 | for i := int64(0); i < *r.rowsPrinted; i++ { 139 | // Clear the row 140 | fmt.Printf("\033[2K") 141 | // Go up one row 142 | fmt.Printf("\033[1A") 143 | } 144 | *r.rowsPrinted = 0 145 | if len(*r.cols) > 0 { 146 | r.printHeader() 147 | } 148 | } 149 | if util.IsRelation(inp) { 150 | // If we haven't printed the header yet 151 | if *r.rowsPrinted >= r.limit && r.limit != -1 { 152 | return 153 | } 154 | if !*r.inRelation { 155 | panic("Can't get relation before StartRelation") 156 | } 157 | colsWidth := render.Columns([]map[string]interface{}{inp}) 158 | colNames := render.ColumnNames(colsWidth) 159 | *r.cols = colNames 160 | *r.colWidths = colsWidth 161 | if *r.rowsPrinted == 0 { 162 | r.printHeader() 163 | } 164 | for _, col := range colNames { 165 | v, _ := inp[col] 166 | vStr := render.Format(v) 167 | spaces := strings.Repeat(" ", colsWidth[col]-len(vStr)) 168 | fmt.Printf("%v%s", vStr, spaces) 169 | } 170 | *r.rowsPrinted++ 171 | fmt.Printf("\n") 172 | } 173 | 174 | if util.IsEndRelation(inp) { 175 | *r.inRelation = false 176 | } 177 | } 178 | 179 | func (r Renderer) printHeader() { 180 | for _, col := range *r.cols { 181 | width := (*r.colWidths)[col] 182 | spaces := strings.Repeat(" ", width-len(col)) 183 | fmt.Printf("%v%s", col, spaces) 184 | } 185 | *r.rowsPrinted += 1 186 | fmt.Printf("\n") 187 | 188 | } 189 | -------------------------------------------------------------------------------- /search/Main.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | import "os" 4 | import "bufio" 5 | import "io" 6 | import "github.com/SumoLogic/sumoshell/util" 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func BuildAndConnect(args []string) { 12 | if len(args[1:]) > 0 { 13 | read(args[1]) 14 | } else { 15 | read("") 16 | } 17 | } 18 | 19 | func read(filterString string) { 20 | r, w := io.Pipe() 21 | handler := util.NewRawInputHandler(w) 22 | go util.ConnectToReader(SumoFilter{filterString, util.NewJsonWriter()}, r) 23 | bio := bufio.NewReader(os.Stdin) 24 | var line, hasMoreInLine, err = bio.ReadLine() 25 | for err != io.EOF || hasMoreInLine { 26 | handler.Process(line) 27 | line, hasMoreInLine, err = bio.ReadLine() 28 | } 29 | handler.Flush() 30 | } 31 | 32 | type SumoFilter struct { 33 | param string 34 | output *util.JsonWriter 35 | } 36 | 37 | func (filt SumoFilter) Process(inp map[string]interface{}) { 38 | if strings.Contains(util.ExtractRaw(inp), filt.param) { 39 | filt.output.Write(inp) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ss/Main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/SumoLogic/sumoshell/average" 6 | "github.com/SumoLogic/sumoshell/count" 7 | "github.com/SumoLogic/sumoshell/expr" 8 | "github.com/SumoLogic/sumoshell/filter" 9 | "github.com/SumoLogic/sumoshell/parse" 10 | "github.com/SumoLogic/sumoshell/sum" 11 | "github.com/SumoLogic/sumoshell/util" 12 | "os" 13 | "time" 14 | ) 15 | 16 | type Builder func([]string) (util.SumoOperator, error) 17 | type AggBuilder func([]string) (util.SumoAggOperator, error) 18 | 19 | func main() { 20 | operators := map[string]Builder{ 21 | "parse": parse.Build, 22 | "filter": filter.Build, 23 | "expr": expr.Build, 24 | } 25 | 26 | aggOperators := map[string]AggBuilder{ 27 | "count": count.Build, 28 | "average": average.Build, 29 | "sum": sum.Build, 30 | } 31 | 32 | args := os.Args 33 | if len(args) == 1 { 34 | fmt.Println("Arguments expected") 35 | } else { 36 | selectingArg := args[1] 37 | builder, ok := operators[selectingArg] 38 | if !ok { 39 | aggBuilder, aggOk := aggOperators[selectingArg] 40 | if !aggOk { 41 | fmt.Println("Operator " + selectingArg + " not found") 42 | return 43 | } 44 | aggOperator, err := aggBuilder(os.Args[1:]) 45 | if err != nil { 46 | fmt.Println(err) 47 | } else { 48 | ticker := time.NewTicker(100 * time.Millisecond) 49 | go flush(aggOperator, ticker) 50 | util.ConnectToStdIn(aggOperator) 51 | // Flush when the stream completes to ensure all data is accounted for 52 | aggOperator.Flush() 53 | } 54 | return 55 | } 56 | 57 | operator, err := builder(os.Args[1:]) 58 | if err != nil { 59 | fmt.Println(err) 60 | } else { 61 | util.ConnectToStdIn(operator) 62 | } 63 | } 64 | } 65 | 66 | func flush(aggOp util.SumoAggOperator, ticker *time.Ticker) { 67 | for { 68 | select { 69 | case <-ticker.C: 70 | aggOp.Flush() 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sum/Sum.go: -------------------------------------------------------------------------------- 1 | package sum 2 | 3 | import ( 4 | "fmt" 5 | "github.com/SumoLogic/sumoshell/group" 6 | "github.com/SumoLogic/sumoshell/util" 7 | "strconv" 8 | "sync" 9 | ) 10 | 11 | type sum struct { 12 | sum *float64 13 | key string 14 | // DO NOT MODIFY BASE 15 | base map[string]interface{} 16 | output func(map[string]interface{}) 17 | mu *sync.Mutex 18 | } 19 | 20 | const Sum = "_sum" 21 | 22 | func makeSum(key string) sum { 23 | sumV := 0.0 24 | return sum{&sumV, key, make(map[string]interface{}), util.NewJsonWriter().Write, &sync.Mutex{}} 25 | } 26 | 27 | func aggregateSum(output grouper.Merger, key string, base map[string]interface{}) util.SumoAggOperator { 28 | sumV := 0.0 29 | return sum{&sumV, key, base, output.Write, &sync.Mutex{}} 30 | } 31 | 32 | func Build(args []string) (util.SumoAggOperator, error) { 33 | // Fist arg is "sum" 34 | args = args[1:] 35 | if len(args) == 1 { 36 | return makeSum(args[0]), nil 37 | } else if len(args) > 1 { 38 | key := args[0] 39 | //_ := relevantArgs[1] 40 | keyFields := args[2:] 41 | return grouper.NewAggregate(aggregateSum, keyFields, key, Sum), nil 42 | } else { 43 | return nil, util.ParseError("Need a argument to average (`sum field`)") 44 | } 45 | } 46 | 47 | func (sumOp sum) Flush() { 48 | sumOp.mu.Lock() 49 | defer sumOp.mu.Unlock() 50 | sumOp.output(util.CreateStartRelation()) 51 | sumOp.output(util.CreateRelation(currentState(sumOp))) 52 | sumOp.output(util.CreateEndRelation()) 53 | } 54 | 55 | func currentState(s sum) map[string]interface{} { 56 | ret := make(map[string]interface{}) 57 | for key, val := range s.base { 58 | ret[key] = val 59 | } 60 | ret[Sum] = *s.sum 61 | return ret 62 | } 63 | 64 | func (s sum) Process(inp map[string]interface{}) { 65 | s.mu.Lock() 66 | defer s.mu.Unlock() 67 | if util.IsStartRelation(inp) { 68 | *s.sum = 0 69 | } else if util.IsPlus(inp) || util.IsRelation(inp) { 70 | v, keyInMap := inp[s.key] 71 | if keyInMap { 72 | f, err := strconv.ParseFloat(fmt.Sprint(v), 64) 73 | if err == nil { 74 | *s.sum += f 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /sumo/Main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "time" 7 | 8 | "github.com/SumoLogic/sumoshell/sumojson" 9 | 10 | "github.com/SumoLogic/sumoshell/average" 11 | "github.com/SumoLogic/sumoshell/count" 12 | "github.com/SumoLogic/sumoshell/expr" 13 | "github.com/SumoLogic/sumoshell/filter" 14 | "github.com/SumoLogic/sumoshell/parse" 15 | "github.com/SumoLogic/sumoshell/search" 16 | "github.com/SumoLogic/sumoshell/sum" 17 | "github.com/SumoLogic/sumoshell/util" 18 | // "sync" 19 | ) 20 | 21 | type Builder func([]string) (util.SumoOperator, error) 22 | type AggBuilder func([]string) (util.SumoAggOperator, error) 23 | 24 | var operators = map[string]Builder{ 25 | "parse": parse.Build, 26 | "filter": filter.Build, 27 | "expr": expr.Build, 28 | } 29 | 30 | var aggOperators = map[string]AggBuilder{ 31 | "count": count.Build, 32 | "average": average.Build, 33 | "sum": sum.Build, 34 | } 35 | 36 | func main() { 37 | args := os.Args 38 | if len(args) == 1 { 39 | fmt.Println("Arguments expected") 40 | } else { 41 | selectingArg := args[1] 42 | actualArgs := os.Args[1:] 43 | nonAggWorked := connectNonAggOperator(selectingArg, actualArgs) 44 | if nonAggWorked { 45 | return 46 | } 47 | 48 | aggWorked := connectAggOperator(selectingArg, actualArgs) 49 | if aggWorked { 50 | return 51 | } 52 | 53 | if selectingArg == "search" { 54 | search.BuildAndConnect(actualArgs) 55 | return 56 | } 57 | 58 | if selectingArg == "json" { 59 | sumojson.BuildAndConnect(actualArgs) 60 | return 61 | } 62 | fmt.Println("Operator " + selectingArg + " unrecognized") 63 | } 64 | } 65 | 66 | func connectAggOperator(selector string, args []string) bool { 67 | aggBuilder, aggOk := aggOperators[selector] 68 | if !aggOk { 69 | return false 70 | } 71 | 72 | aggOperator, err := aggBuilder(args) 73 | if err != nil { 74 | fmt.Println(err) 75 | } else { 76 | ticker := time.NewTicker(100 * time.Millisecond) 77 | done := make(chan bool) 78 | go flush(aggOperator, ticker, done) 79 | util.ConnectToStdIn(aggOperator) 80 | ticker.Stop() 81 | done <- true 82 | // Flush when the stream completes to ensure all data is accounted for 83 | aggOperator.Flush() 84 | } 85 | return true 86 | } 87 | 88 | func connectNonAggOperator(selector string, args []string) bool { 89 | builder, ok := operators[selector] 90 | if ok { 91 | operator, err := builder(args) 92 | handleErrorOrWire(operator, err) 93 | } 94 | return ok 95 | } 96 | 97 | func handleErrorOrWire(operator util.SumoOperator, err error) { 98 | if err != nil { 99 | fmt.Println(err) 100 | } else { 101 | util.ConnectToStdIn(operator) 102 | } 103 | } 104 | 105 | func flush(aggOp util.SumoAggOperator, ticker *time.Ticker, done chan bool) { 106 | for { 107 | select { 108 | case <-ticker.C: 109 | aggOp.Flush() 110 | case <-done: 111 | return 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /util/Raw.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "encoding/json" 7 | "fmt" 8 | "github.com/reiver/go-whitespace" 9 | "io" 10 | "log" 11 | "os" 12 | "sort" 13 | "strconv" 14 | "strings" 15 | "sync" 16 | ) 17 | 18 | type RawInputHandler struct { 19 | output io.Writer 20 | buff []rune 21 | } 22 | 23 | type SumoOperator interface { 24 | Process(map[string]interface{}) 25 | } 26 | 27 | type SumoAggOperator interface { 28 | Process(map[string]interface{}) 29 | Flush() 30 | } 31 | 32 | type ParseError string 33 | 34 | func (e ParseError) Error() string { 35 | return string(e) 36 | } 37 | 38 | func ConnectToStdIn(operator SumoOperator) { 39 | fi, _ := os.Stdin.Stat() // get the FileInfo struct describing the standard input. 40 | if (fi.Mode() & os.ModeCharDevice) == 0 { 41 | ConnectToReader(operator, os.Stdin) 42 | } else { 43 | fmt.Println("No input") 44 | return 45 | } 46 | } 47 | 48 | func ConnectToReader(operator SumoOperator, reader io.Reader) { 49 | bio := bufio.NewReader(reader) 50 | var line, hasMoreInLine, err = bio.ReadLine() 51 | var buf []byte 52 | for err != io.EOF { 53 | buf = append(buf, line...) 54 | if !hasMoreInLine && len(buf) > 0 { 55 | var rawMsg interface{} 56 | err := json.Unmarshal(buf, &rawMsg) 57 | buf = []byte{} 58 | if err != nil { 59 | log.Println("Error parsing json", err) 60 | log.Println(string(line)) 61 | } else { 62 | mapMessage, ok := rawMsg.(map[string]interface{}) 63 | if ok { 64 | operator.Process(mapMessage) 65 | } else { 66 | log.Println("Unexpected JSON") 67 | } 68 | } 69 | } 70 | line, hasMoreInLine, err = bio.ReadLine() 71 | } 72 | } 73 | 74 | const Plus = "PLUS" 75 | const StartRelation = "StartRelation" 76 | const EndRelation = "EndRelation" 77 | const Raw = "_raw" 78 | const Type = "_type" 79 | const Meta = "Meta" 80 | const Relation = "Relation" 81 | 82 | func IsPlus(inp map[string]interface{}) bool { 83 | tpe, ok := inp[Type].(string) 84 | return ok && tpe == Plus 85 | } 86 | 87 | func IsStartRelation(inp map[string]interface{}) bool { 88 | tpe, ok := inp[Type].(string) 89 | return ok && tpe == StartRelation 90 | } 91 | 92 | func IsEndRelation(inp map[string]interface{}) bool { 93 | tpe, ok := inp[Type].(string) 94 | return ok && tpe == EndRelation 95 | } 96 | 97 | func IsRelation(inp map[string]interface{}) bool { 98 | tpe, ok := inp[Type].(string) 99 | return ok && tpe == Relation 100 | } 101 | 102 | func IsMeta(inp map[string]interface{}) bool { 103 | tpe, ok := inp[Type].(string) 104 | return ok && tpe == Meta 105 | } 106 | 107 | func CreateStartRelation() map[string]interface{} { 108 | return map[string]interface{}{Type: StartRelation} 109 | } 110 | 111 | func CreateStartRelationMeta(origin string) map[string]interface{} { 112 | return map[string]interface{}{Type: StartRelation, Meta: origin} 113 | } 114 | 115 | func CreateEndRelation() map[string]interface{} { 116 | return map[string]interface{}{Type: EndRelation} 117 | } 118 | 119 | func CreateRelation(inp map[string]interface{}) map[string]interface{} { 120 | inp[Type] = Relation 121 | return inp 122 | } 123 | 124 | func CreateMeta(inp map[string]interface{}) map[string]interface{} { 125 | inp[Type] = Meta 126 | return inp 127 | } 128 | 129 | func ExtractRaw(inp map[string]interface{}) string { 130 | raw, ok := inp[Raw].(string) 131 | if ok { 132 | return strings.TrimRight(raw, "\n") 133 | } else { 134 | return "" 135 | } 136 | } 137 | 138 | func (handler *RawInputHandler) Process(inp []byte) { 139 | runes := bytes.Runes(inp) 140 | // If not whitespace, flush, append 141 | if len(runes) > 0 && !whitespace.IsWhitespace(runes[0]) { 142 | handler.Flush() 143 | handler.buff = append(handler.buff, runes...) 144 | } else { 145 | // If it is whitespace, just append with a newline 146 | handler.buff = append(handler.buff, '\n') 147 | handler.buff = append(handler.buff, runes...) 148 | } 149 | } 150 | 151 | func NewRawInputHandler(inp io.Writer) *RawInputHandler { 152 | return &RawInputHandler{inp, []rune{}} 153 | } 154 | 155 | func (handler *RawInputHandler) Flush() { 156 | m := make(map[string]interface{}) 157 | m[Raw] = string(handler.buff) 158 | m[Type] = Plus 159 | handler.buff = []rune{} 160 | b, err := json.Marshal(m) 161 | if err != nil { 162 | fmt.Printf("ERROR!", err) 163 | } else { 164 | handler.output.Write(b) 165 | handler.output.Write([]byte{'\n'}) 166 | } 167 | } 168 | 169 | type JsonWriter struct { 170 | writer io.Writer 171 | mu *sync.Mutex 172 | } 173 | 174 | func NewJsonWriter() *JsonWriter { 175 | return &JsonWriter{os.Stdout, &sync.Mutex{}} 176 | } 177 | 178 | func (writer *JsonWriter) Write(inp map[string]interface{}) { 179 | jsonBytes, err := json.Marshal(inp) 180 | //fmt.Printf(b) 181 | if err != nil { 182 | fmt.Printf("ERROR!", err) 183 | } else { 184 | writer.mu.Lock() 185 | writer.writer.Write(jsonBytes) 186 | writer.writer.Write([]byte{'\n'}) 187 | writer.mu.Unlock() 188 | } 189 | } 190 | 191 | func CoerceNumber(v interface{}) (float64, error) { 192 | return strconv.ParseFloat(fmt.Sprint(v), 64) 193 | } 194 | 195 | type Datum []map[string]interface{} 196 | type By func(p1, p2 *map[string]interface{}) bool 197 | 198 | func (a datumSorter) Len() int { return len(a.data) } 199 | func (a datumSorter) Swap(i, j int) { a.data[i], a.data[j] = a.data[j], a.data[i] } 200 | 201 | // planetSorter joins a By function and a slice of Planets to be sorted. 202 | type datumSorter struct { 203 | data Datum 204 | by func(p1, p2 map[string]interface{}) bool // Closure used in the Less method. 205 | } 206 | 207 | func (a datumSorter) Less(i, j int) bool { 208 | return a.by(a.data[i], a.data[j]) 209 | } 210 | 211 | func SortByField(field string, data Datum) { 212 | by := func(p1, p2 map[string]interface{}) bool { 213 | v1, err1 := CoerceNumber(p1[field]) 214 | v2, err2 := CoerceNumber(p2[field]) 215 | 216 | if err1 != nil || err2 != nil { 217 | fmt.Print(data) 218 | panic(err1) 219 | } 220 | 221 | return v1 < v2 222 | } 223 | sort.Sort(sort.Reverse(&datumSorter{data, by})) 224 | } 225 | --------------------------------------------------------------------------------