How to access data from telnet session?

Post Reply
kauerbach
Posts: 30
Joined: Fri Aug 22, 2014 4:52 pm

How to access data from telnet session?

Post by kauerbach » Fri Aug 22, 2014 9:59 pm

Hello,

Can you tell me what parameters to use in a CQL source query for a data stream coming from a server to my PC over port 23?

Thank you.

-snipp-(Remark: Further information added from Marco):

I am not able to use Odysseus to capture a data stream - either with a PQL or a CQL query. Below is a perl script that I can use to display the data flow and below that is some of the output of the data that I've captured from a console window.

The PQL query I'm using looks like this:

Code: Select all

#PARSER PQL
#QUERY
input = ACCESS({source='Source',wrapper='GenericPush',transport='TCPClient',protocol='CSV',
dataHandler='Tuple',options=[['delimiter','\t'],['textDelimiter','\t'],['readfirstline','false'],['delay','100']],
schema=[['keyStr','String'],
['topic','String'],
['metricStr','String'],
['instance','String'],
['timeStr','String'],
['value','String'],
['host','localhost'],
['port','23'],
['ByteOrder','Little_Endian']
]})
and the CQL query I'm using looks like this:

Code: Select all

#PARSER CQL
#QUERY
CREATE STREAM source (keyStr STRING,topic STRING,metricStr STRING,instance STRING,timeStr STRING,value STRING) WRAPPER 'GenericPush'
PROTOCOL 'CSV'
TRANSPORT 'TCPClient'
DATAHANDLER 'Tuple'
OPTIONS ( 'port' '1194', 'host' 'localhost', 'ByteOrder' 'Little_Endian', 'delimiter' '	')
Could you tell me why I'm not able to access the data with Odysseus. Is there some other step that must be performed?

Thank you very much.

The data stream looks like this:

Code: Select all

S	Numeric	E733A5D66159729B41B55954E6382195	20140903 08:32:10.565	80	{0,0}
S	Numeric	FD61CA984C603D59CCADD5811E08AE62	20140903 08:32:10.566	96	{0,0}
S	Numeric	BC5540F2F022F7FA19E3E861CDBF5314	20140903 08:32:11.236	1.5	{1409747531,236000000}
S	Numeric	F6D5D6EE0BC59836CF35BD41E3514DBC	20140903 08:32:11.237	15	{1409747531,237000000}
S	Numeric	0BBCFE45DE7A16F360AD5E300B4FDCFF	20140903 08:32:11.559	80	{0,0}
S	Numeric	6F3BBD17CAEA56FD7198E78C49CE7964	20140903 08:32:11.561	35	{0,0}
S	Numeric	E1A944CF2E821237C5DF0F58E173BAB3	20140903 08:32:11.562	97	{0,0}
S	Numeric	B717578DBD85770124BF9A3018ED88D1	20140903 08:32:11.563	80	{0,0}
S	Numeric	2AD2CA3E26169B445C07A6EEB035E892	20140903 08:32:11.564	120	{0,0}
S	Numeric	E733A5D66159729B41B55954E6382195	20140903 08:32:11.565	80	{0,0}
S	Numeric	FD61CA984C603D59CCADD5811E08AE62	20140903 08:32:11.566	96	{0,0}
S	Numeric	36194119824B161F68EB17E689EE40B0	20140903 08:32:11.667	12	{1409747531,667000000}
S	Numeric	A01D2471B5CC4080EAE07936C1EA3921	20140903 08:32:11.668	5	{1409747531,668000000}
S	Numeric	0BBCFE45DE7A16F360AD5E300B4FDCFF	20140903 08:32:12.559	80	{0,0}
S	Numeric	6F3BBD17CAEA56FD7198E78C49CE7964	20140903 08:32:12.561	35	{0,0}
S	Numeric	E1A944CF2E821237C5DF0F58E173BAB3	20140903 08:32:12.562	97	{0,0}
S	Numeric	B717578DBD85770124BF9A3018ED88D1	20140903 08:32:12.563	80	{0,0}
S	Numeric	2AD2CA3E26169B445C07A6EEB035E892	20140903 08:32:12.564	120	{0,0}
S	Numeric	E733A5D66159729B41B55954E6382195	20140903 08:32:12.566	80	{0,0}
S	Numeric	FD61CA984C603D59CCADD5811E08AE62	20140903 08:32:12.566	96	{0,0}
S	Numeric	BC5540F2F022F7FA19E3E861CDBF5314	20140903 08:32:12.637	1.5	{1409747532,637000000}

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: How to access data from telnet session?

Post by Marco Grawunder » Mon Sep 08, 2014 10:26 am

To get it right, you have a server that send lines to clients connected on port 23? Does each line contain a newline at the end?

host and port should be be part of the schema, but of the option fields.

Please remove the textDelimiter option, it is only necessary for lines containg wrapped strings, your could also change protocol CSV to SimpleCSV (it should be faster).

Code: Select all

#PARSER PQL
#QUERY
input = ACCESS({
source='Source',
wrapper='GenericPush',
transport='TCPClient',
protocol='SimpleCSV',
dataHandler='Tuple',
options=[['delimiter','\t'],['delay','100'],['host','localhost'],['port','23'],['ByteOrder','Little_Endian']],
schema=[['keyStr','String'],
['topic','String'],
['metricStr','String'],
['instance','String'],
['timeStr','String'],
['value','String']
]})
When looking at the line:

Code: Select all

S	Numeric	E733A5D66159729B41B55954E6382195	20140903 08:32:10.565	80	{0,0}
Your current schema seems not to fit:

keyStr=S
topic=Numeric
metricStr=E733A5D66159729B41B55954E6382195
instance=20140903 08:32:10.565
timeStr=80
value={0,0}

kauerbach
Posts: 30
Joined: Fri Aug 22, 2014 4:52 pm

Re: How to access data from telnet session?

Post by kauerbach » Mon Sep 08, 2014 3:04 pm

Hello,

>>S Numeric E733A5D66159729B41B55954E6382195 20140903 08:32:10.565 80 {0,0}
>>Your current schema seems not to fit:
>>
>>keyStr=S
>>metricStr=E733A5D66159729B41B55954E6382195
>>instance=20140903 08:32:10.565
>>timeStr=80
>>value={0,0}

There is actually a tab beween the "20140903" and the "08:32:10.565" . So the mapping is:

keyStr=S
topic=Numeric
metricStr=E733A5D66159729B41B55954E6382195
instance=20140903
timeStr=08:32:10.565
value=80

and I assume the "{0,0}" is a line-end character.

Thank you.
Regards,
Ken Auerbach.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest