Old 23rd March 2015, 12:00   #1
abides
Junior Member
 
Join Date: Nov 2008
Posts: 11
Reading log and SID

Hello,

I'm reading shoutcast v2 logs contains multiple streams, trying to parsing and analyzing. For example;

code:
streamid_1=1
...
...

streamid_2=2
...
...



In the log each event print sid=1 and sid=2 separately but if i change the id numbers of stream something different like;

code:
streamid_1=8 (which represents database id of the stream)


its still shows sid=1 in the log and still working without any error. I didn't get the point to have streamid_1=? in the config if its not written anywhere? There should be some purpose on this config entry.

Option1 : Is it possible to print this id in the logs? That way its extremely easy to parse log file for all streams in it.

Option2 : Or is it possible to separate logs for each stream something like;

code:
streamid_1=1
...
...
streamlog_1=log1.log



Option3 : I should do lots of work to match config file with the logs to figure it out which log has which stream in the database.

Thank you
Best regards
abides is offline   Reply With Quote
Old 24th March 2015, 02:15   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
the sid=xx part in the log is what is relating to the actual stream for those log messages which are stream specific. as not all log messages are stream specific.


the streamid_x=y option doesn't work that way and the 'x' after the underscore is what determines the actual stream#. you generally don't need to specify streamid_x=y yourself if you're using a 2.2 or newer build of the 2.x DNAS and is just something exposed relating to internal implementation details of the 2.x DNAS.

so best not worried about or messed with and just ensure that the number after the underscore on any stream-multi options is what you actually want for the stream number.


without knowing what information you're trying to get from the logs, you might be going about this all wrong. as splitting up the main log file may not ever happen (and if it does, it'd have a number of limitations since not everything can be split in a clean manner). as the w3c logs do have per-stream support (as long as you've configured it) but if you're doing something on the main log, then you'll probably just have to do some sort of scan of the file and match on the sid=xx part as needed.
DrO is offline   Reply With Quote
Old 24th March 2015, 08:06   #3
abides
Junior Member
 
Join Date: Nov 2008
Posts: 11
Hello,

Thank you for your fast reply.

Actually i'm getting almost all information from main log file like stream source start, stream source end, song changes, listener connect, listener disconnect, stream server start...etc. (why i need stream server start?: when something goes wrong and server crashed or closed unexpectedly i need to assume all previously connected listeners are disconnected just before server start again, since i cant see disconnects on the log when this happens.)

These streams created by software which uses a database. Its a custom software managing the streams, starting, stopping, reloading, reconfiguring...etc. So each stream have its own record on the database and have its primary key. When i parse the main log (it could be huge since its high populated stream and there is multiple streams in the same log file) i can split each line, gather required information and prepare the db record file with it. At this point i need to match those sid in the log file with id in the stream database.

This is where my trouble starts. When stream reconfigured (added new stream or changed any of the streams) sid in the log file are start pointing another stream in the database. I need to figure it out how i can make this matching algorithm reliable and fast (its huge file).

That is why i asked if its possible to write actual id number i wrote in the config file to sid in the main log file. This way i don't need to do anything since all sid in the main log will point my id in the database. Now i know its not possible because its used by DNAS. So is it possible to write that parameter (if its added in the config file) to log with different variable like customid:xx or cid:xx?

Sorry about long wall of text, thats the only way to explain my intentions.
Thank you.
abides is offline   Reply With Quote
Old 24th March 2015, 11:56   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
if the id you want to use for a stream is 123456 then all of the config options relating to that stream need to be <config_item>_123456=<config_value> which will then create a stream with id# 123456 and sid=123456 is what will appear in the logs.

so what you want to do is more than achievable already.
DrO is offline   Reply With Quote
Old 24th March 2015, 13:54   #5
abides
Junior Member
 
Join Date: Nov 2008
Posts: 11
Oh, i didn't aware of i can do that. I mean i always thought it should start with 1 and continue with increment per 1 for the streams. If i can create stream something like;

streamid_57=57
...
...

streamid_99=99
....
....

for 2 streams then you are right, its already achieveable.

Thank you, Best regards
abides is offline   Reply With Quote
Old 24th March 2015, 14:01   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
you can start at any number. and if you only want to allow what you've configured, ensure you set requirestreamconfigs=1 otherwise if someone has a valid password then they can connect on any un-configured stream (which is probably not what you want for your setup).
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump