ELK Config
ELK Config
.\bin\elasticsearch.bat
1. node.name: elk-primary-node
2. network.host: 10.11.200.117
3. http.port: 9200
4. xpack.security.enabled: true
5. xpack.security.enrollment.enabled: true
6. xpack.security.http.ssl:
7. enabled: true
8. keystore.path: certs/http.p12
9. xpack.security.transport.ssl:
10. enabled: true
11. verification_mode: certificate
ELK Stack Documentation
Though all setup will automatically after elastic search installation if you want to change
any parameters as your need you can to it from where.
Step 5: Go to any browser and provide https://<IP address>:9200 press enter then it will give a
confirmation prompt, provide elastic search user name password that before you saved
credential from the comment prompt.
Kibana Installation:
Step 1 (installation): https://www.elastic.co/guide/en/kibana/current/targz.html ,
https://www.elastic.co/guide/en/kibana/current/rpm.html
Step 2: http:<IP address>:5602 then provide token that are found from elastic search
installation.
Step 3: Open kibana.yml file and do some configuration.
server.port: 5602
server.host: "10.11.200.117"
elasticsearch.hosts: ['https://10.11.200.117:9201']
elasticsearch.serviceAccountToken:
AAEAAWVsYXN0aWMva2liYW5hL2Vucm9sbC1wcm9jZXNzLXRva2VuLTE2NjkwODkyNzUyMzM6bEV4SVN4O
E9SSXEyVU95VmxJQy1xUQ
elasticsearch.ssl.certificateAuthorities: ['E:\Elastic Cluster\kibana-
8.4.0\data\ca_1669089276037.crt']
xpack.fleet.outputs: [{id: fleet-default-output, name: default, is_default: true,
is_default_monitoring: true, type: elasticsearch, hosts:
['https://10.11.200.117:9200'], ca_trusted_fingerprint:
a26cc1843a2e9a6b4e1de247a10ed7707e0ce084baa099913ae046965ee3448e}]
Step 5: To configure Kibana to start automatically when the system starts, run the following
commands (Linux):
.\bin\kibana.bat
ELK Stack Documentation
Kibana can be started and stopped (linux) as follows:
Logstash Installation:
Step 1(installation): https://www.elastic.co/guide/en/logstash/current/installing-logstash.html
Offline oracle data pass in Elastic search:
1) Pipeline Script: Create a pipeline script for data shipment.
input {
jdbc {
jdbc_validate_connection => true
jdbc_connection_string => "jdbc:oracle:thin:@10.11.1.45:1521/emob"
jdbc_user => "asik"
jdbc_password => "AbsEra#123"
jdbc_driver_library => "D:/elasticstack/doc/ojdbc8.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
statement => "SELECT * FROM(SELECT REQUEST_DATE,
INCENTIVE_AMOUNT,
REMARKS2,
BEN_ADDRESS,
apex_web_service.blob2clobbase64 (b.DOC_FRONT_IMG) DOC_FRONT,
apex_web_service.blob2clobbase64 (b.DOC_BACK_IMG) DOC_BACK,
apex_web_service.blob2clobbase64 (b.DOC_BACK_IMG) IMG
FROM archival.RM_PAYMENT_REQUEST_HIST a, archival.RM_REMITTANCE_DOC_HIST b
WHERE a.REQUEST_ID = b.REQUEST_ID)"
}
}
output {
elasticsearch {
hosts => ["https://localhost:9200"]
index => "remittance_doc"
user => "elastic"
password => "oNqFYft-c2tskbUFyHM9"
ssl => true
cacert => 'D:/elasticstack/elasticsearch-8.4.0/config/certs/http_ca.crt'
}
stdout {}
}
ELK Stack Documentation
2) Run: bin/logstash –f “/D:/elk/ora_pipeline.conf”
input {
file {
path => "D:/elasticstack/doc/*.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
}
filter {
csv {
separator =>","
columns =>
["id","name","host_id","host_name","neighbourhood_group","neighbourhood","lat
itude","longitude","room_type","price","minimum_nights","number_of_reviews","
last_review","reviews_per_month","calculated_host_listings_count","availabili
ty_365"]
}
}
output {
elasticsearch {
hosts => ["https://localhost:9200"]
index => "ab_nyc_2019"
user => "elastic"
password => "oNqFYft-c2tskbUFyHM9"
ssl => true
cacert => 'D:/elasticstack/elasticsearch-
8.4.0/config/certs/http_ca.crt'
}
stdout {}
}
3) After Enabling apache module you will find a file named apache.yml, open
this file and do some changes – ( for access log)
-module: apache
# Access logs
access:
enabled: true
Logstash Configuration:
input{
beats{
port => 5244
host => "10.11.202.10"
}
}
filter{
grok {
match => {"message" => '%{HTTPD_COMMONLOG} "%{GREEDYDATA:referrer}"
"%{GREEDYDATA:agent}"'}
}
if "_grokparsefailure" in [tags]{
ELK Stack Documentation
drop {}
}
useragent{
source => "[event][original]"
target => "uos"
}
# ip2location {
# source => "%{[source][address]}"
# }
# geoip{
# source => "%{[source][address]}"
# target => "geo"
# }
mutate {
add_field =>{
"host_name" =>"%{[host][name]}"
"verb" =>"%{[http][request][method]}"
"http_version" =>"%{[http][version]}"
"status_code" =>"%{[http][response][status_code]}"
"log_time" =>"%{[timestamp]}"
"req_ip" =>"%{[source][address]}"
"os_name" => "%{[uos][os][name]}"
"os_full_name" => "%{[uos][os][full]}"
"os_version" => "%{[uos][os][version]}"
"browser_name" => "%{[uos][name]}"
"browser_varsion" =>"%{[uos][version]}"
}
ruby{
code => "
str = event.get('referrer');
v = (str =~ /=/);
v_data = str[v+1, str.length];
v_app = (v_data =~ /:/i);
a = v_data[0,v_app];
ELK Stack Documentation
b = v_data[v_app+1,v_data.length];
v_page_id = (b =~ /:/i);
c = b[0,v_page_id];
d = b[v_page_id+1,b.length];
v_session_id = (d =~ /:/i);
e = d[0,v_session_id];
event.set('app_id',a);
event.set('page_id',c);
event.set('app_session',e);
"
}
if "_rubyexception" in [tags]{
drop {}
}
}
#output{
# stdout {
# codec => rubydebug
# }
#}
output {
elasticsearch {
hosts => ["https://10.11.200.109:9200"]
manage_template => false
index => "apache_log-%{+YYYY.MM.dd}"
user => "fardaus"
password => "123456"
ssl => true
cacert => '/home/elk-stack/elk/certs/http_ca.crt'
}
stdout {}
}
- pipeline.id: pipeline_apache_log
path.config: "/etc/logstash/conf.d/apache_pipeline.conf"
ELK Stack Documentation
For Oracle Apex (http.d) Configuration:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
Alias /j/ "/etc/httpd/j/"
<Directory "/etc/httpd/j">
#Options Indexes MultiViews FollowSymLinks
AllowOverride None
Options None
Require all granted
</Directory># Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf