This project allow you to tail a fileset remotely.
- Clone this repo
- Choose a path where you want to put your configuration, and create it on your local machine (eg. /var/remote-tailer/my-cfg)
- Copy to your preferred path all "src/main/examples/" content (config.xml)
-
Open "config.xml" (eg. /var/remote-tailer/my-cfg/config.xml) and apply your configuration, as the example below:
- <input> is **required** node
- <host> is a **required** node where you put your remote host for ssh remote connection
- <port> is an **optional** node where you put your ssh remote port. The default value is **22**
- <username> is a **required** node where you put your credentials
- <password> is a **required** node where you put your credentials
- <output> is a **required** node where you put your remote file. Please take a look below for more details
<config>
<tailer>
<input type="FILE">
<host>syslxlog1c</host>
<port>22</port>
<username>your_user</username>
<password>your_pwd</password>
<filePath>/your/path/file.log</filePath>
</input>
<output>
<rollingFileAppender>
<fileRootPath>/tmp/your/path</fileRootPath>
<fileNamePattern>%d{yyyy-MM-dd}/file.%d{yyyy-MM-dd_HH}.log</fileNamePattern>
</rollingFileAppender>
</output>
</tailer>
</config>
Restriction: At this moment just a single output could be configured!
Param | Type | Description | Default |
---|---|---|---|
deleteOnStart | attribute (boolean) | Delete the root path on start | false |
layoutPattern | attribute (String) | Using firefox browser instance | %msg |
fileRootPath | node | Based on ClassicPatternLayout (http://logback.qos.ch/manual/layouts.html#ClassicPatternLayout) | |
fileNamePattern | node | Based on TimeBasedRollingPolicy (http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy) |
Param | Type | Description | Default |
---|---|---|---|
layoutPattern | attribute (String) | Using firefox browser instance | %msg |
You are ready to execute your remote-tailer.
Simple open your console (shell), point to your cloned repo (at pom.xml level) and call the command below:
mvn -f pom.xml compile exec:java -Dexec.mainClass=org.bitmarte.architecture.utils.remotetailer.Main -Dexec.args="/var/remote-tailer/my-cfg"
Pay attention: specify your base config path as the only require java argument ("/var/remote-tailer/my-cfg" for this tutorial)