This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven-without-a-parent --> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<!-- Import dependency management from Spring Boot --> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-dependencies</artifactId> | |
<version>2.1.5.RELEASE</version> | |
<type>pom</type> | |
<scope>import</scope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set relativenumber | |
set showmode | |
set number | |
syntax on | |
set autoindent | |
set tabstop=2 | |
set shiftwidth=4 | |
set expandtab | |
set softtabstop=2 | |
set showmatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_driver_library => "D:\repo\mysql\mysql-connector-java\5.1.40\mysql-connector-java-5.1.40.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
jdbc_connection_string => "jdbc:mysql://xxx:8840/data" | |
jdbc_user => "xxx" | |
jdbc_password => "xxx@ed" | |
statement => "SELECT * FROM xxx_t_job_function_net_bak20140828 WHERE id = :id" | |
parameters => { "id" => 3510 } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [serviceContexts] and [serviceContexts][0] { | |
# array has at least one element | |
} else { | |
# array has no elements | |
} | |
if ![http_body][json] or !([http_body][json] =~ ".+") | |
if ("" in [foo]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_driver_library => "/Users/wangxc/Develop/maven/repo/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
jdbc_connection_string => "jdbc:mysql://localhost:3308/test" | |
jdbc_user => "root" | |
jdbc_password => "123456" | |
statement => "SELECT * FROM account" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_driver_library => "/usr/local/logstash/sqlserver/sqljdbc4-4.0.jar" | |
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver" | |
jdbc_connection_string => "jdbc:sqlserver://xxx:xxx;DatabaseName=xxx" | |
jdbc_user => "xxx" | |
jdbc_password => "xxx" | |
jdbc_paging_enabled => "true" | |
jdbc_fetch_size => 200000 | |
jdbc_page_size => 200000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExecutorService executor = Executors.newFixedThreadPool(45); | |
for(...){ | |
executor.execute(()->{ | |
// do something | |
}); | |
} | |
try { | |
// awaitTermination返回false即超时会继续循环,返回true即线程池中的线程执行完成主线程跳出循环往下执行,每隔10秒循环一次 | |
while (!executor.awaitTermination(10, TimeUnit.SECONDS)){} | |
} catch (Exception e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => ["/data/test.log"] | |
start_position => "beginning" | |
sincedb_path => "/dev/null" ## 主要是这句,sincedb_path 会将每次读取的数据做标识存进日志中,如果日志为空,则认为是最新的数据 | |
} | |
} | |
output { | |
stdout { | |
codec => rubydebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String classFilePath = WordCount.class.getResource("/").getPath(); | |
// 获取resource下的文件 | |
String classFilePath = WordCount.class.getResource("/blsmy.txt").getPath(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => ["/usr/local/logstash/conf/lbd2tbd/wait_transfer_txt.txt"] | |
start_position => "beginning" | |
sincedb_path => "/dev/null" | |
} | |
} | |
filter { | |
mutate { |