Searching, mining, visualization and cluster management of big data are very necessary in today\'s \"Internet +\" era. The distributed big data search, log mining, visualization, cluster monitoring and management solutions in this book are based on Elastic Stack 5, which can effectively deal with the distributed data storage and processing, full-text search, log mining, visualization, cluster management and performance monitoring problems brought by massive big data. Elasticsearch, built on the full-text search open source software Lucene, can not only complete distributed indexing and retrieval of massive data, but also provide data aggregation analysis; Logstash can effectively process log information from various data sources; Kibana is a web interface that provides data analysis for Elasticsearch, which can be used to perform efficient search, visualization, analysis and other operations on data; X-Pack monitoring components can monitor the status of the cluster through Kibana; Beats is an agent for collecting system monitoring data. It is very necessary to understand the relevant components based on Elastic Stack 5 and master their basic usage methods and skills for big data search, mining and management. Compared with the first and second editions, this book strives to reflect the latest achievements based on the Elastic Stack 5 architecture, with novel content and emphasis on practice. This book can help students in related majors (such as computer science and technology, software engineering, Internet of Things, information management and information systems, data science and big data technology) in colleges and universities to learn and research, and it also has high reference value and engineering application value for engineers and technicians engaged in big data search and mining, log analysis, information visualization, cluster management and performance monitoring, and those who want to understand network information retrieval technology. Chapter 1 Overview 1 1.1 Overview of Elasticsearch 3 1.1.1 Installation and simple configuration of Elasticsearch 4 1.1.2 Simple use of Elasticsearch API 7 1.2 Logstash 7 1.3 Kibana 8 1.4 Others 8 1.5 Extended knowledge and reading 9 1.6 Summary of this chapter 10 Chapter 2 Document indexing and management 11 2.1 Overview of document indexing 11 2.2 Head: Elasticsearch\'s data management tool 13 2.3 Index creation 16 2.4 Configuring indexes through image mappings 20 2.4.1 Using images in indexes 21 2.4.2 Managing/configuring images 22 2.4.3 Obtaining image information 22 2.4.4 Deleting images 24 2.5 Managing index files 24 2.5.1 Opening, closing, detecting, and deleting index files 24 2.5.2 Clearing the index cache 25 2.5.3 Refreshing index data 25 2.5.4 Optimizing index data 26 2.5.5 Flush operation 26 [1] [2] [1] [3] 2.6 Set up Chinese analyzer 26 2.7 Other operations on documents 29 2.7.1 Get the specified document information 29 2.7.2 Delete information in the document 31 2.7.3 Data update 31 2.7.4 Batch obtain documents based on POST method 34 2.8 Examples 36 2.9 Extended knowledge and reading 40 2.10 Summary of this chapter 41 Chapter 3 Information Retrieval and Aggregation 42 3.1 Experimental Dataset Description 43 3.2 Basic Retrieval 44 3.2.1 Retrieval method 44 3.2.2 Query query 45 3.2.3 from / size query 45 3.2.4 Query result sorting 46 3.2.5 Highlight search terms 48 3.2.6 Query template 50 3.3 Advanced retrieval 50 3.3.1 Full-text retrieval 51 3.3.2 Term retrieval 54 3.3.3 Compound query 58 3.3.4 Span query 60 3.3.5 Special query 63 3.3.6 Script 64 3.4 Aggregation 67 3.4.1 Metrics aggregations 68 3.4.2 Bucket aggregations 72 3.4.3 Pipeline aggregations 81 3.4.4 Matrix aggregations 85 3.5 Examples 87 3.6 Further knowledge and reading 92 3.7 Summary of this chapter 93 Chapter 4 Partial implementation of Elasticsearch Client for Java 94 4.1 Instantiating Elasticsearch nodes 94 4.1.1 Adding Elasticsearch dependencies through Maven 94 4.1.2 Initializing TransportClient 96 4.2 Indexing data 98 4.2.1 Preparing JSON data 98 4.2.2 Indexing JSON data 100 4.3 Operations on indexed documents 101 4.3.1 Obtaining indexed document data 101 4.3.2 Deleting Index Documents 104 4.3.3 Updating Index Documents 105 4.3.4 Batch Operations on Index Files 105 4.4 Information Retrieval 107 4.4.1 Overview 107 4.4.2 MultiSearch 109 4.4.3 Search template 110 4.4.4 Query DSL Overview 110 4.4.5 matchAllQuery 111 4.4.6 Some Methods for Full-Text Search 112 4.4.7 Some Methods for Term Search 115 4.4.8 Some Methods for Compound Query 119 4.4.9 Some Methods for Span Query 121 4.4.10 Special Query 124 4.5 Aggregation 126 4.5.1 Metrics Aggregation 126 4.5.2 Bucket Aggregation 130 4.6 Further Processing of Search Results 134 4.6.1 Controlling the Number of Displayed Results per Page and the Display Sorting Criteria 134 4.6.2 Scroll-based search results and paging 135 4.7 Examples 137 4.7.1 Create an index in Elasticsearch 137 4.7.2 Connect to Elasticsearch 138 4.7.3 Information collection and index construction 139 4.7.4 Implementation of the search module 141 4.7.5 Implementation of the recommendation module 142 4.7.6 Implementation of the aggregation module 143 4.8 Extended knowledge and reading 145 4.9 Summary of this chapter 145 Chapter 5 Elasticsearch Configuration and Cluster Management 146 5.1 Some basic configurations of Elasticsearch and their descriptions 146 5.2 Optimizing index and query efficiency 149 5.3 Monitoring cluster status 150 5.4 Controlling index sharding and replica allocation 152 5.5 Cluster management 154 5.6 Extended knowledge and reading 155 5.7 Summary of this chapter 156 Chapter 6 Log processing based on Logstash 157 6.1 Overview 158 6.2 Input: Processing input log data 160 6.2.1 Processing log information based on file input 161 6.2.2 Processing log information generated by generator 162 6.2.3 Processing log information based on log4j 163 6.2.4 Processing log information based on redis 165 6.2.5 Processing information based on stdin input 168 6.2.6 Processing log data based on TCP transmission 169 6.2.7 Processing log data based on UDP transmission 173 6.3 codecs: Formatting log data 174 6.3.1 JSON format 175 6.3.2 rubydebug format 177 6.3.3 plain format 177 6.4 Log processing and conversion based on filter 178 6.4.1 JSON filter 178 6.4.2 grok filter 180 6.4.3 kv filter 182 6.5 output: Output log data 184 6.5.1 Output the processed log to Elasticsearch 185 6.5.2 Output the processed log to a file 186 6.5.3 Output part of the processed log to a csv file 187 6.5.4 Output the processed log to redis 189 6.5.5 Output part of the processed log through the UDP protocol 190 6.5.6 Output part of the processed log through the TCP protocol 192 6.5.7 Transmit the collected log information to a custom HTTP interface 195 6.6 Extended knowledge and reading 196 6.7 Summary of this chapter 197 Chapter 7 Data analysis and visualization based on Kibana 198 7.1 Overview of Kibana 199 7.2 Install Kibana 199 7.3 Manage configurations with Management 200 7.3.1 Add an index pattern 200 7.3.2 Advanced settings 202 7.3.3 Manage saved searches, visualizations, and dashboards 205 7.4 Run queries with Discover 206 7.4.1 Set a time filter 206 7.4.2 Search in an index pattern 207 7.4.3 Field filtering 208 7.4.4 View document data 210 7.5 Create statistical charts with Visualize 211 7.6 Create dynamic dashboards with Dashboard 214 7.6.1 Create a new dynamic dashboard 215 7.6.2 Open a saved dynamic dashboard 215 7.6.3 Share a dynamic dashboard 216 7.7 Create a timeline with Timelion 216 7.8 Run command lines with Dev Tools 218 7.8.1 Run commands in the Console 218 7.8.2 Console shortcuts 220 7.8.3 Console Configuration 221 7.9 Design and Implementation of Visualization Application for Website Performance Monitoring 221 7.9.1 Overview 222 7.9.2 Visualization with Visualize 222 7.9.3 Integrate Visualization Results with Dashboard 225 7.10 Extended Knowledge and Reading 227 7.11 Summary of This Chapter 227 Chapter 8 System Operation Monitoring Based on XPack 229 8.1 Overview of XPack 229 8.2 Installing XPack 230 8.3 Security Plug-in and Security 231 8.3.1 Authentication Mechanism and User Management 231 8.3.2 Anonymous Access 233 8.3.3 Domain-Based User Authentication 234 8.3.4 Role-Based Access Permission Configuration 236 8.3.5 IP Filtering 238 8.3.6 TransportClient with Authentication 240 8.3.7 RESTful Commands with Authentication 243 8.4 Using Monitoring to Monitor System Status 243 8.4.1 Monitoring System Status 243 8.4.2 Configuring Monitoring 247 8.4.3 Building an Independent Monitoring Cluster 248 8.5 Alerting Plugins and Abnormal Event Alerts 250 8.5.1 Setting Up Monitors in RESTful Mode 250 8.5.2 Setting Up Monitors in a Java Program 254 8.6 Reporting and Report Generation 256 8.6.1 Generating Reports in Programs 256 8.6.2 Automatically Generating Reports through Monitors 257 8.7 Using Graph to Explore Data Associations 259 8.8 Extended Knowledge and Reading 261 8.9 Summary of This Chapter 261 Chapter 9 Data Parsing and Transmission Based on Beats 262 9.1 Network Packet Transmission Based on Packetbeat 263 9.1.1 Overview 263 9.1.2 Installation 263 9.1.3 Configuration 264 9.1.4 Loading Index Templates 266 9.1.5 Startup and shutdown 267 9.1.6 Display with Kibana 268 9.2 Log transmission based on Filebeat 269 9.2.1 Overview 269 9.2.2 Installation and configuration 269 9.2.3 Startup and shutdown 272 9.2.4 Display with Kibana 272 9.3 System indicator data transmission based on Metricbeat 273 9.3.1 Overview 273 9.3.2 Installation and configuration 274 9.3.3 Startup and shutdown 275 9.3.4 Display with Kibana 276 9.4 Windows event log data transmission based on Winlogbeat 277 9.4.1 Overview 277 9.4.2 Installation 278 9.4.3 Configuration 279 9.4.4 Startup and shutdown 282 9.4.5 Display with Kibana 283 9.5 Extended knowledge and reading 284 9.6 Chapter Summary 285 Chapter 10 Network Information Retrieval and Analysis Practice 1 286 10.1 Information Collection 286 10.2 Information Retrieval and Web-side Design Based on Python 291 10.2.1 Install Python and Django 291 10.2.2 Install the Python Plugin for Elasticsearch 292 10.2.3 Web Page Design 293 10.3 Log Processing Based on Logstash 296 10.3.1 Install and Configure Nginx 297 10.3.2 Design Patterns for Log Files 297 10.3.3 Related Configurations in Logstash 298 10.4 Visualization Design and Implementation of Log Analysis Results Based on Kibana 299 10.4.1 Chart 1: Status Code Trend Analysis 300 10.4.2 Chart 2: Query Word Analysis 302 10.4.3 Chart 3: Analysis of the Changes of Status Codes over Time 302 10.4.4 Integration Chart 304 10.5 Extended Knowledge and Reading 304 10.6 Summary of this Chapter 305 Chapter 11 Network Information Retrieval and Analysis Practice 2 306 11.1 Information Collection for Dynamic Websites 307 11.1.1 Software Preparation 307 11.1.2 Browser Driver Preparation 307 11.1.3 Create Indexes and Images 308 11.1.4 Import Dependencies 309 11.1.5 Data Collection 310 11.2 Information Retrieval and Web Programming Based on Spring MVC 317 11.2.1 Create and Configure Spring MVC Project 317 11.2.2 Front-end Page Design 319 11.2.3 Back-end Controller Class 324 11.3 Log Processing Based on Logstash 329 11.4 Data Transmission Based on Beats 330 11.5 Data Visualization Based on Kibana 331 11.5.1 Visualize Information in Index Files 331 11.5.2 Visualization of Logstash and Beats 333 11.6 System Monitoring Based on X-Pack 335 11.7 Extended Knowledge and Reading 337 11.8 Chapter Summary 337 References 3391 Setting up monitors in a RESTful way 250 8.5.2 Setting up monitors in a Java program 254 8.6 Reporting and report generation 256 8.6.1 Generating reports in a program 256 8.6.2 Automatically generating reports through monitors 257 8.7 Using Graph to explore data associations 259 8.8 Extended knowledge and reading 261 8.9 Summary of this chapter 261 Chapter 9 Data parsing and transmission based on Beats 262 9.1 Network packet transmission based on Packetbeat 263 9.1.1 Overview 263 9.1.2 Installation 263 9.1.3 Configuration 264 9.1.4 Loading index templates 266 9.1.5 Startup and shutdown 267 9.1.6 Display using Kibana 268 9.2 Log transmission based on Filebeat 269 9.2.1 Overview 269 9.2.2 Installation and configuration 269 9.2.3 Startup and shutdown 272 9.2.4 Display with Kibana 272 9.3 System Metrics Data Transmission Based on Metricbeat 273 9.3.1 Overview 273 9.3.2 Installation and Configuration 274 9.3.3 Startup and Shutdown 275 9.3.4 Display with Kibana 276 9.4 Windows Event Log Data Transmission Based on Winlogbeat 277 9.4.1 Overview 277 9.4.2 Installation 278 9.4.3 Configuration 279 9.4.4 Startup and Shutdown 282 9.4.5 Display with Kibana 283 9.5 Extended Knowledge and Reading 284 9.6 Summary of this Chapter 285 Chapter 10 Network Information Retrieval and Analysis Practice 1 286 10.1 Information Collection 286 10.2 Information Retrieval and Web-side Design Based on Python 291 10.2.1 Install Python and Django 291 10.2.2 Install the Python Plugin for Elasticsearch 292 10.2.3 Web Page Design 293 10.3 Log Processing Based on Logstash 296 10.3.1 Install and Configure Nginx 297 10.3.2 Design Patterns for Log Files 297 10.3.3 Perform Related Configurations in Logstash 298 10.4 Visualization Design and Implementation of Log Analysis Results Based on Kibana 299 10.4.1 Chart 1: Status Code Trend Analysis 300 10.4.2 Chart 2: Query Word Analysis 302 10.4.3 Chart 3: Analysis of the Changes of Status Codes over Time 302 10.4.4 Integrated Charts 304 10.5 Extended Knowledge and Reading 304 10.6 Summary of This Chapter 305 Chapter 11 Network Information Retrieval and Analysis Practice 2 306 11.1 Information Collection for Dynamic Websites 307 11.1.1 Software Preparation 307 11.1.2 Browser Driver Preparation 307 11.1.3 Creating Indexes and Images 308 11.1.4 Importing Dependencies 309 11.1.5 Data Collection 310 11.2 Information Retrieval and Web Programming Based on Spring MVC 317 11.2.1 Creating and Configuring Spring MVC Projects 317 11.2.2 Front-end Page Design 319 11.2.3 Back-end Controller Class 324 11.3 Log Processing Based on Logstash 329 11.4 Data Transmission Based on Beats 330 11.5 Data Visualization Based on Kibana 331 11.5.1 Visualizing Information in Index Files 331 11.5.2 Visualizing Logstash and Beats 333 11.6 System Monitoring Based on XPack 335 11.7 Further Knowledge and Reading 337 11.8 Chapter Summary 337 References 3391 Setting up monitors in a RESTful way 250 8.5.2 Setting up monitors in a Java program 254 8.6 Reporting and report generation 256 8.6.1 Generating reports in a program 256 8.6.2 Automatically generating reports through monitors 257 8.7 Using Graph to explore data associations 259 8.8 Extended knowledge and reading 261 8.9 Summary of this chapter 261 Chapter 9 Data parsing and transmission based on Beats 262 9.1 Network packet transmission based on Packetbeat 263 9.1.1 Overview 263 9.1.2 Installation 263 9.1.3 Configuration 264 9.1.4 Loading index templates 266 9.1.5 Startup and shutdown 267 9.1.6 Display using Kibana 268 9.2 Log transmission based on Filebeat 269 9.2.1 Overview 269 9.2.2 Installation and configuration 269 9.2.3 Startup and shutdown 272 9.2.4 Display with Kibana 272 9.3 System Metrics Data Transmission Based on Metricbeat 273 9.3.1 Overview 273 9.3.2 Installation and Configuration 274 9.3.3 Startup and Shutdown 275 9.3.4 Display with Kibana 276 9.4 Windows Event Log Data Transmission Based on Winlogbeat 277 9.4.1 Overview 277 9.4.2 Installation 278 9.4.3 Configuration 279 9.4.4 Startup and Shutdown 282 9.4.5 Display with Kibana 283 9.5 Extended Knowledge and Reading 284 9.6 Summary of this Chapter 285 Chapter 10 Network Information Retrieval and Analysis Practice 1 286 10.1 Information Collection 286 10.2 Information Retrieval and Web-side Design Based on Python 291 10.2.1 Install Python and Django 291 10.2.2 Install the Python Plugin for Elasticsearch 292 10.2.3 Web Page Design 293 10.3 Log Processing Based on Logstash 296 10.3.1 Install and Configure Nginx 297 10.3.2 Design Patterns for Log Files 297 10.3.3 Perform Related Configurations in Logstash 298 10.4 Visualization Design and Implementation of Log Analysis Results Based on Kibana 299 10.4.1 Chart 1: Status Code Trend Analysis 300 10.4.2 Chart 2: Query Word Analysis 302 10.4.3 Chart 3: Analysis of the Changes of Status Codes over Time 302 10.4.4 Integrated Charts 304 10.5 Extended Knowledge and Reading 304 10.6 Summary of This Chapter 305 Chapter 11 Network Information Retrieval and Analysis Practice 2 306 11.1 Information Collection for Dynamic Websites 307 11.1.1 Software Preparation 307 11.1.2 Browser Driver Preparation 307 11.1.3 Creating Indexes and Images 308 11.1.4 Importing Dependencies 309 11.1.5 Data Collection 310 11.2 Information Retrieval and Web Programming Based on Spring MVC 317 11.2.1 Creating and Configuring Spring MVC Projects 317 11.2.2 Front-end Page Design 319 11.2.3 Back-end Controller Class 324 11.3 Log Processing Based on Logstash 329 11.4 Data Transmission Based on Beats 330 11.5 Data Visualization Based on Kibana 331 11.5.1 Visualizing Information in Index Files 331 11.5.2 Visualizing Logstash and Beats 333 11.6 System Monitoring Based on XPack 335 11.7 Further Knowledge and Reading 337 11.8 Chapter Summary 337 References 339
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore