Skip to content

Tail a fileset remotely with a simple XML configuration

Notifications You must be signed in to change notification settings

skimdz86/remote-tailer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Remote tailer

This project allow you to tail a fileset remotely.



Tailer Setup

  1. Clone this repo
  2. Choose a path where you want to put your configuration, and create it on your local machine (eg. /var/remote-tailer/my-cfg)
  3. Copy to your preferred path all "src/main/examples/" content (config.xml)
  4. 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>

output

Restriction: At this moment just a single output could be configured!

rollingFileAppender

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)

stdOutAppender

Param Type Description Default
layoutPattern attribute (String) Using firefox browser instance %msg

Execute your remote-tailer instance and enjoy it :)

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)

About

Tail a fileset remotely with a simple XML configuration

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%