-
Popularaly known as ELK stack ( Elastic search, Logstash, Kibana)
-
Who uses ELK?
- To be Added
-
Cloud Providers (Managed Infrastruture for Search implementations)
-
Google Cloud: https://console.cloud.google.com/marketplace/details/click-to-deploy-images/elasticsearch
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
$ git revert -m 1 mergeCommitNumber | |
https://www.christianengvall.se/undo-pushed-merge-git/ | |
https://education.github.com/git-cheat-sheet-education.pdf |
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
int page = 0; | |
Page<Entity> pages = repo.findAll(PageRequest.of(page, 1000)); | |
while(!pages.isLast()) { | |
List<Entity> content = pages.getContent(); | |
// Do your thing with the content | |
Pageable pageable = pages.nextPageable(); | |
pages = submissionRepo.findAll(pageable); | |
log.info("page number {} size:{}, offset:{}",pageable.getPageNumber(),pageable.getPageSize(),pageable.getOffset()); | |
} |
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
spring.data.elasticsearch.cluster-nodes=localhost:9300 | |
spring.data.elasticsearch.properties.cluster.name=elasticsearch | |
spring.data.elasticsearch.properties.client.transport.sniff=true | |
spring.data.elasticsearch.properties.client.transport.ignore_cluster_name=true | |
spring.data.elasticsearch.properties.client.transport.ping_timeout=5s | |
spring.data.elasticsearch.properties.client.transport.nodes_sampler_interval=5s |
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/Path/dev-apps/logstash-6.5.4/mysql-java-connector/mysql-connector-java-5.1.46.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
jdbc_connection_string => "jdbc:mysql://localhost:3306/elastic-search-test" | |
schedule => "* * * * *" | |
jdbc_user => "root" | |
jdbc_password => "mysqlN01" | |
statement => "SELECT * from person where id > :sql_last_value" | |
jdbc_paging_enabled => "true" |
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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
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
<h1> | |
This link helps to quickly create a sample spring boot project | |
</h1> | |
https://start.spring.io/starter.zip?name=autoTestExperiment&groupId=edu.wgu.ema&artifactId=autoTestExperiment&version=0.0.1-SNAPSHOT&description=Demo+project+for+Spring+Boot&packageName=edu.wgu.ema.katas&type=maven-project&packaging=jar&javaVersion=1.8&language=java&bootVersion=1.5.19.RELEASE&dependencies=lombok&dependencies=configuration-processor&dependencies=devtools&dependencies=mysql&dependencies=data-jpa&dependencies=web | |
------- ---------- |
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
package com.amit; | |
import org.apache.commons.lang3.time.StopWatch; | |
import lombok.extern.slf4j.Slf4j; | |
/** | |
* Hello world! | |
* | |
*/ |
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
private void getFile() throws IOException { | |
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); | |
List<Resource> files = Arrays.asList(resolver.getResources("classpath*:folder-name")); | |
for(Resource file : files) { | |
for(File file1 : file.getFile().listFiles()) { | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<property name="logPattern" | |
value="%d %-5level %logger{35} - %msg%n" /> | |
<property name="logEncoding" value="UTF-8" /> | |
<property name="logDirectory" value="logs" /> |