@thinkingai/ae-cli 6.1.38 → 6.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +2 -0
  3. package/dist/{ai-monitor-UL2O7J4X.js → ai-monitor-DST4NDOK.js} +5 -5
  4. package/dist/ai-monitor.js +7 -7
  5. package/dist/{auth-ERWVKQDG.js → auth-BD3NIY3T.js} +3 -3
  6. package/dist/{automation-OQ647CSW.js → automation-IMDCJUML.js} +85 -9
  7. package/dist/{capability-HPP6E3ZX.js → capability-3NJOQHZQ.js} +3 -3
  8. package/dist/{chunk-DKOGWIYQ.js → chunk-24DCOJBJ.js} +2 -2
  9. package/dist/{chunk-SHB7A2JE.js → chunk-2RORKIF6.js} +2 -2
  10. package/dist/{chunk-HBI7IQH3.js → chunk-6NJZSWUT.js} +3 -28
  11. package/dist/{chunk-QPUPWGZ3.js → chunk-DTODOQ6T.js} +1 -1
  12. package/dist/{chunk-PCQTBRPT.js → chunk-FRJUB66C.js} +1 -1
  13. package/dist/{chunk-ZLJZPPPV.js → chunk-IY5G42YY.js} +2 -2
  14. package/dist/{chunk-JRXSLFCA.js → chunk-KBJHBVO7.js} +1 -1
  15. package/dist/{chunk-CYZV5AXW.js → chunk-KE5WGBXS.js} +2 -1
  16. package/dist/chunk-N2MAYIRU.js +32 -0
  17. package/dist/{chunk-DULCIC67.js → chunk-SQEK6S4X.js} +2 -3
  18. package/dist/{chunk-VPLRZSMY.js → chunk-STHIGWWC.js} +10 -1
  19. package/dist/{chunk-BWEQIKA3.js → chunk-TVSGS5QB.js} +5 -5
  20. package/dist/{chunk-LXRALNNA.js → chunk-UK7HQ4IL.js} +1 -1
  21. package/dist/{chunk-NDX4VJO7.js → chunk-VXKKTUU2.js} +2 -2
  22. package/dist/{chunk-E5CJI7L3.js → chunk-WRYXVIJP.js} +1 -1
  23. package/dist/{compat-check-WRPEFB5N.js → compat-check-7VBBE7KO.js} +1 -1
  24. package/dist/{config-IS33K45R.js → config-LFRZBPH5.js} +3 -3
  25. package/dist/{context-Y2A6QIS3.js → context-WJQGJD6F.js} +1 -1
  26. package/dist/{data-integration-EIF5QHYF.js → data-integration-KMJWYAKK.js} +2 -1
  27. package/dist/index.js +34 -32
  28. package/dist/{memory-6QMZS4HF.js → memory-VPOPSU52.js} +3 -3
  29. package/dist/{metadata-TMAXVLOL.js → metadata-AR64J76Z.js} +5 -5
  30. package/dist/{model-LEYRQKOS.js → model-2F2354QP.js} +1 -1
  31. package/dist/{personal-semantic-preference-RMZEDRCJ.js → personal-semantic-preference-BCOSI4DO.js} +4 -4
  32. package/dist/{project-semantic-UD3OAZ6K.js → project-semantic-DJLXAXLD.js} +4 -4
  33. package/dist/{sync-GVF3OI2U.js → sync-4TUIQ2PZ.js} +3 -3
  34. package/dist/{te-agent-S7UH657Z.js → te-agent-EMDWA3M6.js} +4 -4
  35. package/dist/{te-analysis-SJIE5OZY.js → te-analysis-XHAMRMTQ.js} +5 -5
  36. package/dist/{te-community-VNHJDEID.js → te-community-JSUSZEYH.js} +4 -4
  37. package/dist/{te-dataops-AO4OQBQV.js → te-dataops-I264BUTI.js} +2 -2
  38. package/dist/{te-engage-EZJRFG3Q.js → te-engage-XNMQYO5N.js} +68 -16
  39. package/dist/{te-experiment-R2MNSAKV.js → te-experiment-5SCHMYVO.js} +4 -4
  40. package/dist/{te-kb-C44A4BHM.js → te-kb-QQ53TNRZ.js} +44 -13
  41. package/dist/{te-system-DB5Z3LLF.js → te-system-Z4VEB6PL.js} +1 -1
  42. package/dist/{te-team-J52STTEZ.js → te-team-V6BBI52R.js} +87 -6
  43. package/dist/{things-G2QFXDK7.js → things-THHGDSEC.js} +4 -4
  44. package/dist/{update-GEKOZMHU.js → update-53ZUXWV5.js} +2 -2
  45. package/dist/{web-runtime-5M7PRY7R.js → web-runtime-ZJHOIPKX.js} +4 -4
  46. package/dist/{workspace-RZESYB6T.js → workspace-W5ZPVWJS.js} +3 -3
  47. package/package.json +3 -3
  48. package/skills/ae-automation/SKILL.md +6 -2
  49. package/skills/ae-automation/references/cli.md +9 -3
  50. package/skills/ae-engage/SKILL.md +6 -1
  51. package/skills/ae-engage/references/common-metric.md +47 -1
  52. package/skills/ae-engage/references/flow-metric-update.md +1 -1
  53. package/skills/ae-engage/references/task-metric-update.md +1 -1
  54. package/skills/ae-experiment/SKILL.md +1 -1
  55. package/skills/ae-experiment/references/save_experiment.md +1 -1
  56. package/skills/ae-kb/SKILL.md +8 -6
  57. package/skills/ae-kb/references/query-workflow.md +5 -1
  58. package/skills/ae-team/SKILL.md +7 -3
  59. package/skills/ae-team/references/copy-to-personal.md +7 -0
  60. package/skills/ae-team/references/promote.md +7 -0
  61. package/skills/ae-team/references/update.md +3 -3
  62. package/skills/ae-tracking-matrix/SKILL.md +0 -170
  63. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  64. package/skills/ae-tracking-matrix/i18n.yaml +0 -12
  65. package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
  66. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
  67. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
  68. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
  69. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
  70. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
  71. package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
  72. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
  73. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
  74. package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
  75. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
  76. package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
  77. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
  78. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
  79. package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
  80. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
  81. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
  82. package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
  83. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
  84. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
  85. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
  86. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
  87. package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
  88. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
  89. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
  90. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
  91. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
  92. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
  93. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
  94. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
  95. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
  96. package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
  97. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
  98. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
  99. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
  100. package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
  101. package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
  102. package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
  103. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
  104. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
  105. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
  106. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
  107. package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
  108. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
  109. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
  110. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
  111. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
  112. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
  113. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
  114. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
  115. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
  116. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
  117. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
  118. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
  119. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
  120. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
  121. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
  122. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
  123. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
  124. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
  125. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
  126. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
  127. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
  128. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
  129. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
  130. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
  131. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
  132. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
  133. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
  134. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
  135. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
  136. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
  137. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
  138. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
  139. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
  140. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
  141. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
  142. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
  143. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
  144. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
  145. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
  146. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
  147. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
  148. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
  149. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
  150. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
  151. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
  152. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
  153. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
  154. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
  155. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
  156. package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
  157. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
  158. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
  159. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
  160. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
  161. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
  162. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
  163. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
  164. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
  165. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
  166. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
  167. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
  168. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
  169. package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
  170. package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
  171. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
  172. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
  173. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
  174. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
  175. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
  176. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
  177. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
  178. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
  179. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
  180. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
  181. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
  182. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
  183. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
  184. package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
  185. package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
  186. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
  187. package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
  188. package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
@@ -1,645 +0,0 @@
1
- ---
2
- code: filebeat_logstash_installation
3
- name: "Filebeat + Logstash Usage Guide"
4
- wikiToken: FiOpwljqpi2CotkX9ofc7rDRnHc
5
- parentWikiToken: RjUcwyNY8iQH1dk8SP9cPyz1ngf
6
- updateTime: 1745310935000
7
- sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=filebeat_logstash_installation
8
- ---
9
-
10
- # Filebeat + Logstash Usage Guide
11
-
12
- This section mainly introduces the usage method of data transmission tool Filebeat + Logstash:
13
-
14
- **Before starting integration, you need to read Data Rules first. After becoming familiar with TE data format and data rules, then read this guide for integration.**
15
-
16
- **Filebeat + Logstash uploaded data must follow TE data format**
17
-
18
- **Note: Logstash throughput is low. If importing large amounts of historical data, recommend using DataX engine or Logbus tool**
19
-
20
- ### 1. Filebeat + Logstash Introduction
21
-
22
- Filebeat + Logstash tool is mainly used to import log data to TE backend in real-time, monitor file streams in server log directory. When any log file in the directory has new data generated, send to TE backend in real-time.
23
-
24
- Logstash is an open-source server-side data processing pipeline that can collect data from multiple sources simultaneously, transform data, then send data to your favorite "repository". Logstash official website introduction
25
-
26
- Filebeat is a local file log data collector that can monitor log directories or specific log files (tail file). Filebeat provides a lightweight method for forwarding and summarizing logs and files. Filebeat official website introduction
27
-
28
- Based on Filebeat + Logstash collection flow diagram as shown below:
29
-
30
- ### 2. Filebeat + Logstash Download and Installation
31
-
32
- **Note: Logstash-6.x or above version, server needs JDK environment**
33
-
34
- #### 2.2 Logstash Download and Installation
35
-
36
- Refer to Logstash official website installation documentation, please choose method to download
37
-
38
- #### 2.3 logstash-output-thinkingdata Plugin
39
-
40
- **Latest version**: 1.2.0
41
-
42
- **Update date**: 2023-04-25
43
-
44
- ##### 2.3.1 Install and Uninstall logstash-output-thinkingdata Plugin
45
-
46
- This plugin checks whether data is json data, packages data and sends to TE
47
-
48
- Execute in logstash directory:
49
-
50
- ```
51
- bin/logstash-plugin install logstash-output-thinkingdata
52
- ```
53
-
54
- Installation needs some time, please wait patiently for installation success, then execute:
55
-
56
- ```
57
- bin/logstash-plugin list
58
- ```
59
-
60
- If **logstash-output-thinkingdata** is in the list, it means installation is successful.
61
-
62
- Other commands as shown:
63
-
64
- Upgrade plugin can execute:
65
-
66
- ```
67
- bin/logstash-plugin update logstash-output-thinkingdata
68
- ```
69
-
70
- Uninstall plugin can execute:
71
-
72
- ```
73
- bin/logstash-plugin uninstall logstash-output-thinkingdata
74
- ```
75
-
76
- ##### 2.3.2 Change Log
77
-
78
- ###### **v1.2.1 2023/07/26**
79
-
80
- - Added format validation for data in message
81
-
82
- ###### **v1.2.0 2023/04/25**
83
-
84
- - Supports multiple data in message
85
-
86
- ###### **v1.1.0 2021/01/27**
87
-
88
- - Added support for #app_id format in data
89
-
90
- ###### **v1.0.0 2020/06/09**
91
-
92
- - Receive message passed by Logstash event and send to TE
93
-
94
- #### 2.4 Filebeat Download and Installation
95
-
96
- Refer to Filebeat official installation documentation, please choose method to download
97
-
98
- ### 3. Filebeat + Logstash Usage Instructions
99
-
100
- #### 3.1 Data Preparation
101
-
102
- 1. First, ETL convert the data to be transmitted into TE data format, and write to local or transmit to Kafka cluster. If using Java or other server SDK's write Kafka or local file consumer, data is already correct format, no need to convert again.
103
-
104
- 2. Determine the directory where uploaded data files are stored, or Kafka address and topic, and configure Filebeat + Logstash related configurations. Filebeat + Logstash will monitor file changes in file directory (monitor file creation or tail existing files), or subscribe to data in Kafka.
105
-
106
- 3. Do not directly rename data logs that have been uploaded and stored in monitoring directory. Renaming logs is equivalent to creating new files. Filebeat may re-upload these files, causing data duplication.
107
-
108
- #### 3.2 Logstash Configuration
109
-
110
- ##### 3.2.1 Logstash Pipeline Configuration
111
-
112
- Logstash supports running multiple Pipelines simultaneously. Each Pipeline is independent, has its own input output configuration. Pipeline configuration file is located at config/pipelines.yml. If you are currently using Logstash to complete some other log collection work, you can add a Pipeline specifically responsible for collecting TE log data on original Logstash, and send to TE.
113
-
114
- New Pipeline configuration as follows:
115
-
116
- ```
117
- # thinkingdata pipeline configuration
118
- - pipeline.id: thinkingdata-output
119
- # If uploading user properties core count set to 1, if only uploading event properties can set less than or equal to local cpu count
120
- pipeline.workers: 1
121
- # Buffer queue type used
122
- queue.type: persisted
123
- # Use different input output configuration
124
- path.config: "/home/elk/conf/ta_output.conf"
125
- ```
126
-
127
- More Pipeline configuration official website: Pipeline
128
-
129
- ##### 3.2.2 Logstash Input Output Configuration
130
-
131
- ta_output.conf reference example:
132
-
133
- ::: tip Note
134
-
135
- Here scenario is based on files generated by SDK, Logstash output input configuration
136
-
137
- :::
138
-
139
- ```
140
- # Use beats as input
141
- input {
142
- beats {
143
- port => "5044"
144
- }
145
- }
146
- # If not server SDK generated or data conforming to TE format, need filter to filter metadata, here recommend ruby plugin filter, fourth module has example
147
- #filter {
148
- # if "log4j" in [tags] {
149
- # ruby {
150
- # path => "/home/elk/conf/rb/log4j_filter.rb"
151
- # }
152
- # }
153
- #}
154
- # Use thinkingdata as output
155
- output{
156
- thinkingdata {
157
- url => "http://data_collection_address/logbus"
158
- appid =>"your AppID"
159
- }
160
- }
161
- ```
162
-
163
- thinkingdata parameter description:
164
-
165
- **Parameter Name**
166
-
167
- **Type**
168
-
169
- **Required**
170
-
171
- **Default Value**
172
-
173
- **Description**
174
-
175
- url
176
-
177
- string
178
-
179
- true
180
-
181
- None
182
-
183
- TE data receiver address
184
-
185
- appid
186
-
187
- string
188
-
189
- true
190
-
191
- None
192
-
193
- Project APPID
194
-
195
- flush_interval_sec
196
-
197
- number
198
-
199
- false
200
-
201
- 2
202
-
203
- Trigger flush interval time, unit: seconds
204
-
205
- flush_batch_size
206
-
207
- number
208
-
209
- false
210
-
211
- 500
212
-
213
- Trigger flush json data, unit: records
214
-
215
- compress
216
-
217
- number
218
-
219
- false
220
-
221
- 1
222
-
223
- Compress data, 0 means no compression, can set in internal network; 1 means gzip compression, default gzip compression
224
-
225
- uuid
226
-
227
- boolean
228
-
229
- false
230
-
231
- false
232
-
233
- Whether to enable UUID switch, for deduplication when network fluctuation may occur in short time interval
234
-
235
- is_filebeat_status_record
236
-
237
- boolean
238
-
239
- false
240
-
241
- true
242
-
243
- Whether to enable Filebeat monitoring log status, such as offset, file name, etc.
244
-
245
- ##### 3.2.3 Logstash Running Configuration
246
-
247
- Logstash defaults to use **config/logstash.yml** as running configuration.
248
-
249
- ```
250
- pipeline.workers: 1
251
- queue.type: persisted
252
- queue.drain: true
253
- ```
254
-
255
- **Recommendations**
256
-
257
- 1. When user_set uploads user properties, please change pipeline.workers value to 1. When workers value is greater than 1, it will cause data processing order change. track events can set greater than 1.
258
- 1. To ensure data transmission does not lose due to program accidental termination, please set queue.type: persisted, represents Logstash used buffer queue type. This configuration can continue to send data in buffer queue after restarting Logstash.
259
- **More data persistence related can see official website** persistent-queues
260
-
261
- 1. Set queue.drain value to true. This configuration will make Logstash send all data in buffer queue before normal exit.
262
- **More details can see official website** logstash.yml
263
-
264
- ##### 3.2.4 Logstash Startup
265
-
266
- In Logstash installation directory:
267
-
268
- 1. Direct startup, use config/pipelines.yml as Pipeline configuration and running configuration
269
-
270
- ```
271
- bin/logstash
272
- ```
273
-
274
- 2. Specify ta_output.conf as input output configuration file startup, will use config/logstash.yml as running configuration
275
-
276
- ```
277
- bin/logstash -f /youpath/ta_output.conf
278
- ```
279
-
280
- 3. Background startup
281
-
282
- ```
283
- nohup bin/logstash -f /youpath/ta_output.conf > /dev/null 2>&1 &
284
- ```
285
-
286
- More startup, can see Logstash official startup documentation
287
-
288
- #### 3.3 Filebeat Configuration
289
-
290
- ##### 3.3.1 Filebeat Running Configuration
291
-
292
- Filebeat reads backend SDK log files. Filebeat default configuration file: filebeat.yml. config/filebeat.yml reference configuration as follows:
293
-
294
- ```
295
- #======================= Filebeat inputs =========================
296
- filebeat.shutdown_timeout: 5s
297
- filebeat.inputs:
298
- - type: log
299
- enabled: true
300
- paths:
301
- - /var/log/log.*
302
- #- c:\programdata\elasticsearch\logs\*
303
- #------------------------- Logstash output ----------------------------
304
- output.logstash:
305
- # Can fill one server process, or multiple Logstash processes on multiple servers
306
- hosts: ["ip1:5044","ip2:5044"]
307
- loadbalance: false
308
- ```
309
-
310
- 1. shutdown_timeout: Filebeat shutdown time waiting for publisher to complete sending events before closing.
311
- 1. **paths**: Specify logs to monitor. Currently processed according to Go language glob function, no recursive processing for configured directory.
312
- 1. **hosts**: Send address to multiple Logstash hosts. When loadbalance is false similar to primary standby function, true represents load balancing
313
- 1. **loadbalance**: If there is user_set user property upload, do not set loadbalance: true. Setting will use round-robin method to send data to all Logstash, which may cause data order disorder.
314
- If only importing track events, can set multiple Logstash processes, and can set loadbalance: true. Filebeat default configuration is loadbalance: false
315
-
316
- Filebeat materials can see: Filebeat official documentation
317
-
318
- ##### 3.3.2 Filebeat Startup
319
-
320
- After filebeat startup, view related output information:
321
-
322
- ```
323
- ./filebeat -e -c filebeat.yml
324
- ```
325
-
326
- Background startup
327
-
328
- ```
329
- nohup ./filebeat -c filebeat.yml > /dev/null 2>&1 &
330
- ```
331
-
332
- ### 4. Case Configuration Reference
333
-
334
- #### 4.1 Filebeat Monitoring Different Log Format Data Configuration
335
-
336
- Single Filebeat filebeat.xml can set as follows, running memory about 10 MB. Can also start multiple filebeat processes to monitor different log formats, refer to official website for details
337
-
338
- ```
339
- #=========================== Filebeat inputs =============================
340
-
341
- filebeat.inputs:
342
- - type: log
343
- enabled: true
344
- #Monitor directory
345
- paths:
346
- - /home/elk/sdk/*/log.*
347
- #Tag data, Logstash match, no need for filter processing
348
- tags: ["sdklog"]
349
- #Data split by special character
350
- - type: log
351
- enable: true
352
- paths: /home/txt/split.*
353
- #Tag data, Logstash match, need filter processing
354
- tags: ["split"]
355
- # log4j received data
356
- - type: log
357
- enable: true
358
- paths: /home/web/logs/*.log
359
- # Need filter processing
360
- tags: ["log4j"]
361
- # log4j received data
362
- # nginx log data
363
- - type: log
364
- enable: true
365
- paths: /home/web/logs/*.log
366
- tags: ["nginx"]
367
- ```
368
-
369
- #### 4.2 Logstash Configuration
370
-
371
- Check whether Logstash configuration file has error
372
-
373
- ```
374
- bin/logstash -f /home/elk/ta_output.conf --config.test_and_exit
375
- ```
376
-
377
- **Note: All ruby plugins in following scripts are written based on ruby syntax. If you are familiar with java, can use custom parser in logbus directory**
378
-
379
- ##### 4.2.1 Server SDK Log
380
-
381
- ta_output.conf can set as follows
382
-
383
- ```
384
- input {
385
- beats {
386
- port => "5044"
387
- }
388
- }
389
- # Use thinkingdata as output
390
- output{
391
- thinkingdata {
392
- url => "url"
393
- appid =>"appid"
394
- # compress => 0
395
- # uuid => true
396
- }
397
- }
398
- ```
399
-
400
- ##### 4.2.2 log4j Log
401
-
402
- log4j format can set as follows, set according to business log situation:
403
-
404
- ```
405
- //Log format
406
- //[%d{yyyy-MM-dd HH:mm:ss.SSS}] Log conforms to TE input time, can also be yyyy-MM-dd HH:mm:ss
407
- //[%level{length=5}] Log level, debug, info, warn, error
408
- //[%thread-%tid] Current thread information
409
- //[%logger] Current log information belongs to class full path
410
- //[%X{hostName}] Current node hostname. Need to customize through MDC.
411
- //[%X{ip}] Current node ip. Need to customize through MDC.
412
- //[%X{userId}] User login unique ID, can set account_id, or other value. TE requires account_id and distinct_id cannot both be empty, can set other properties, see business settings. Need to customize through MDC.
413
- //[%X{applicationName}] Current application name. Need to customize through MDC.
414
- //[%F,%L,%C,%M] %F: Current log information belongs to file (class) name, %L: Log information line number in file, %C: Current log belongs to file full class name, %M: Current log belongs to method name
415
- //[%m] Log detail
416
- //%ex Exception information
417
- //%n Line break
418
- <property name="patternLayout">[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%level{length=5}] [%thread-%tid] [%logger] [%X{hostName}] [%X{ip}] [%X{userId}] [%X{applicationName}] [%F,%L,%C,%M] [%m] ## '%ex'%n
419
- </property>
420
- ```
421
-
422
- ta_output.conf configuration
423
-
424
- ```
425
- input {
426
- beats {
427
- port => "5044"
428
- }
429
- }
430
- filter {
431
- if "log4j" in [tags]{
432
- #Can also do other filter data processing
433
- ruby {
434
- path => "/home/conf/log4j.rb"
435
- }
436
- }
437
- }
438
- # Use thinkingdata as output
439
- output{
440
- thinkingdata {
441
- url => "url"
442
- appid =>"appid"
443
- }
444
- }
445
- ```
446
-
447
- /home/conf/log4j.rb script as follows
448
-
449
- ```
450
- # Here through parameter event can get all attributes in input
451
- def filter(event)
452
- _message = event.get('message') #message is your uploaded each log
453
- begin
454
- #Here regex out correct data format, if error log recommend put in separate file, error log too long no analysis scenario, and cross line
455
- #Here data similar to this format _message ="[2020-06-08 23:19:56.003] [INFO] [main-1] [cn.thinkingdata] [x] [123.123.123.123] [x] [x] [StartupInfoLogger.java,50,o)] ## ''"
456
- mess = /\[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] \[(.*?)\] ## '(.*?)'/.match(_message)
457
- time = mess[1]
458
- level = mess[2]
459
- thread = mess[3]
460
- class_name_all = mess[4]
461
- event_name = mess[5]
462
- ip = mess[6]
463
- account_id = mess[7]
464
- application_name = mess[8]
465
- other_mess = mess[9]
466
- exp = mess[10]
467
-
468
- if event_name.empty? || account_id.empty?
469
- return []
470
- end
471
-
472
- properties = {
473
- 'level' => level,
474
- 'thread' => thread,
475
- 'application_name' => application_name,
476
- 'class_name_all' => class_name_all,
477
- 'other_mess' => other_mess,
478
- 'exp' => exp
479
- }
480
-
481
- data = {
482
- '#ip' => ip,
483
- '#time' => time,
484
- '#account_id'=>account_id,
485
- '#event_name'=>event_name, #If type is track can use, if no #event_name no upload
486
- '#type' =>'track', #Can get from file, if in file, confirm whether upload data is user property or event property
487
- 'properties' => properties
488
- }
489
-
490
- event.set('message',data.to_json)
491
- return [event]
492
- rescue
493
- # puts _message
494
- puts "Data does not conform to regex format"
495
- return [] #No upload
496
- end
497
- end
498
- ```
499
-
500
- ##### 4.2.3 Nginx Log
501
-
502
- First define Nginx log format. If set to json format:
503
-
504
- ```
505
- input {
506
- beats {
507
- port => "5044"
508
- }
509
- }
510
- filter {
511
- #If same format data no need to judge tags
512
- if "nginx" in [tags]{
513
- ruby {
514
- path => "/home/conf/nginx.rb"
515
- }
516
- }
517
- }
518
- # Use thinkingdata as output
519
- output{
520
- thinkingdata {
521
- url => "url"
522
- appid =>"appid"
523
- }
524
- }
525
- ```
526
-
527
- /home/conf/nginx.rb script as follows:
528
-
529
- ```
530
- require 'date'
531
- def filter(event)
532
- #Take similar log information
533
- # {"accessip_list":"124.207.82.22","client_ip":"123.207.82.22","http_host":"203.195.163.239","@timestamp":"2020-06-03T19:47:42+08:00","method":"GET","url":"/urlpath","status":"304","http_referer":"-","body_bytes_sent":"0","request_time":"0.000","user_agent":"s","total_bytes_sent":"180","server_ip":"10.104.137.230"}
534
- logdata= event.get('message')
535
- #Parse log level and request time, and save to event object
536
- #Parse json format log
537
- #Get log content
538
- #Convert to json object
539
- logInfoJson=JSON.parse logdata
540
- time = DateTime.parse(logInfoJson['@timestamp']).to_time.localtime.strftime('%Y-%m-%d %H:%M:%S')
541
- url = logInfoJson['url']
542
- account_id = logInfoJson['user_agent']
543
- #event_name
544
- #account_id or #distinct_id both null, skip upload
545
- if url.empty? || url == "/" || account_id.empty?
546
- return []
547
- end
548
- properties = {
549
- "accessip_list" => logInfoJson['accessip_list'],
550
- "http_host"=>logInfoJson['http_host'],
551
- "method" => logInfoJson['method'],
552
- "url"=>logInfoJson['url'],
553
- "status" => logInfoJson['status'].to_i,
554
- "http_referer" => logInfoJson['http_referer'],
555
- "body_bytes_sent" =>logInfoJson['body_bytes_sent'],
556
- "request_time" => logInfoJson['request_time'],
557
- "total_bytes_sent" => logInfoJson['total_bytes_sent'],
558
- "server_ip" => logInfoJson['server_ip'],
559
- }
560
- data = {
561
- '#ip' => logInfoJson['client_ip'],#Can be null
562
- '#time' => time, #Cannot be null
563
- '#account_id'=>account_id, # account_id and distinct_id cannot both be null
564
- '#event_name'=>url, #If type is track can use, if no #event_name no upload
565
- '#type' =>'track', #Can get from file, if in file, confirm whether upload data is user property or event property
566
- 'properties' => properties
567
- }
568
- event.set('message',data.to_json)
569
- return [event]
570
-
571
- end
572
- ```
573
-
574
- ##### 4.2.4 Other Logs
575
-
576
- ta_output.conf configuration as follows
577
-
578
- ```
579
- input {
580
- beats {
581
- port => "5044"
582
- }
583
- }
584
- filter {
585
- if "other" in [tags]{
586
- #Can also do other filter data processing
587
- ruby {
588
- path => "/home/conf/outher.rb"
589
- }
590
- }
591
- }
592
- # Use thinkingdata as output
593
- output{
594
- thinkingdata {
595
- url => "url"
596
- appid =>"appid"
597
- }
598
- }
599
- ```
600
-
601
- /home/conf/outher.rb script as follows:
602
-
603
- ```
604
- # def register(params)
605
- # # Here through params get parameters passed through script_params in logstash file
606
- # #@message = params["xx"]
607
- # end
608
- def filter(event)
609
- #Here process business data, if no grok and other processing, directly get metadata in message for processing
610
- begin
611
- _message = event.get('message') #message is your uploaded each log
612
- #Here processed log similar to following data
613
- #2020-06-01 22:20:11.222,123455,123.123.123.123,login,nihaoaaaaa,400
614
- time,account_id,ip,event_name,msg,intdata=_message.split(/,/)
615
- #Or through regex match data, or json data, ruby syntax parse json, can process data here for data upload
616
- #mess = /regex/.match(_message)
617
- #time = mess[1]
618
- #level = mess[2]
619
- #thread = mess[3]
620
- #class_name_all = mess[4]
621
- #event_name = mess[5]
622
- #account_id = mess[6]
623
- #api = mess[7]
624
-
625
- properties = {
626
- 'msg' => msg,
627
- 'int_data' => intdata.to_i #to_i is int type, to_f is float type, to_s is string type (default)
628
- }
629
- data = {
630
- '#time' => time,
631
- '#account_id'=>account_id,
632
- '#event_name'=>event_name,
633
- '#ip' => ip,
634
- '#type' =>'track',
635
- 'properties' => properties
636
- }
637
- event.set('message',data.to_json)
638
-
639
- return [event]
640
- rescue
641
- #If do not want certain data to pass or error, this data can return empty, such as account_id or distinct_id both null directly return []
642
- return []
643
- end
644
- end
645
- ```