1. Home
  2. Know how
  3. How to Connect Client to the server and Sending sample data to the server
  1. Home
  2. Videos
  3. How to Connect Client to the server and Sending sample data to the server

How to Connect Client to the server and Sending sample data to the server

Connecting Client to server:

To Connect Client to the server follow the below procedure:

  • Check whether Elastic search, Kibana, and Logstash are running.

From Logstash we need to run the database config file and it will take some time to connect to the database.

Example to run a sample file as shown below:

input {

jdbc {
jdbc_driver_library => “path for jdbc driver library”
# ORACLE Driver Class
jdbc_driver_class => “Java::oracle.jdbc.driver.OracleDriver”
jdbc_default_timezone => “America/New_York”
# ORACLE jdbc connection string to our database, ORACLE jdbc:oracle:thin:@hostname:PORT/SERVICE
jdbc_connection_string => “jdbc:oracle:thin:@cdldftff2-scan.es.ad.adp.com:1521/mft11d_svc1”
# The user and password we wish to execute our statement as
jdbc_user => “username”
jdbc_password => “password”
schedule => “* * * * *”
statement => “SELECT trim(FGA._KEY) as processId,FGA.FILE_NAME as localFileName,FGA.FILE_SIZE as filesize,FGA.MAILBOX_PATH as srcmailboxPath,FGA.MAILBOX_PATH as mailboxPath> :sql_last_value”
}
}
filter {
mutate {
add_field => {“read_timestamp” => “%{@timestamp}”}
remove_field => [“@version”,”removekey”,”type”]
rename => { “msgtxt” => “msgTxt” “processid” =>”processId” “localfilename” => “localFileName” “remotefilename” => “remoteFileName” “clientid” => “clientId” “clientname” => “clientName” “nodeid” => “nodeId”}
}
}
output {

kafka {

topic_id => “gps”

bootstrap_servers => “ip-name(Kafka):9092”

codec => json

}

stdout { codec=>rubydebug }
}

Run the below command to start logstash.

  • ./bin/logstash -f stdinout.conf
  • stdinout.conf is the configuration file.
  • After running the conf file and wait for a few minutes it will run the logstash script.

If it is not running or if you get any error message, then check the logs file in logstash.

While running the script it will send the sample data to the server.

 

 

Updated on July 29, 2019

Was this article helpful?

Related Articles

Leave a Comment