Populate an input window with entries from a log file.
Procedure
- Open Studio and create a new project with a name of your choice.
- In the CCL editor, remove the input stream, NEWSTREAM, and add the following:
CREATE MEMORY STORE store1 PROPERTIES INDEXTYPE ='hash', INDEXSIZEHINT =8;
CREATE INPUT WINDOW TestStream
SCHEMA ("Date" MSDATE, Host STRING, Request STRING, Rfc931 STRING,
UserName STRING, Referrer STRING, Cookies STRING, Status INTEGER,
Agent STRING)
PRIMARY KEY ("Date")
STORE store1;
- Compile and run the project.
- Edit the
STREAMING_HOME/adapters/logfile_input/example.properties
file:
- Set Output.Uri to the URI where the project is running. For example,
esp[s]://localhost:9786/default/logfile_example.
- Set Output.AuthType to UserPassword.
- Set Output.Username to the username you set for your local cluster.
- Set Output.Password to the password you set for your local cluster.
- Start the adapter:
- Open a command line and navigate to
STREAMING_HOME/adapters/logfile_input.
- Execute the following command:
- In
Windows,
java -cp %CP% -Dproperties=example.properties com.adapter.logFileInput.Main
- In
Unix,
java -cp $CP -Dproperties=example.properties com.adapter.logFileInput.Main
- Open the TestStream window in the Stream View of Studio to confirm that
the window is populated with data from the
STREAMING_HOME/adapters/logfile_input/example.log
file.