{"id":3363,"date":"2014-10-25T00:35:14","date_gmt":"2014-10-25T00:35:14","guid":{"rendered":"http:\/\/www.fingerpost.co.uk\/wp\/programme-documentation\/ipstatd\/"},"modified":"2014-10-25T00:35:14","modified_gmt":"2014-10-25T00:35:14","slug":"ipstatd","status":"publish","type":"page","link":"https:\/\/www.fingerpost.co.uk\/wp\/programme-documentation\/ipstatd\/","title":{"rendered":"ipstatd  (Sat Oct 25 2014 01:31:01)"},"content":{"rendered":"<pre>\nipstatd\n\nThis is the daemon for the statistics database.\n\nIt uses a parameter file is used to route and process incoming files. This\nparameter is normally the name of the database to update which is normally the\ncontents of the FipHdr field DB and defaults to tables\/stat\/DATABASE.\n\nIt first uses a selection table to decide what the type of data this really is.\nAs the list is top down, only the first valid selection is processed.\n\nIPSTATD then uses the 'type' to run a sequence of programs predefined in the\nparameter file.\n\nThe syntax for the DATABASE file is :\n\t; comment\n\t; the following is a selection line\n\t(hdr field) = string [opt (tab) &amp; (hdr) = string ...] (tab) &gt;typename (nl)\n\ttype: (typename)\t(program to run)\n\ttrace: (typename)\n\ttest: (typename)\n\nTo describe the Selection syntax in detail :\n\t(hdr field) = string [opt (tab) &amp; (hdr) = string ...] (tab) &gt;typename (nl)\n\tEach selection is on a single line. If necessary, multiple conditions\n\t\tcan be specified with the '&amp;' to 'and' them.\n\tThe operation equal, '=', can also be NOT equal '!='.\n\tSource Header fields (in SH) are preceeded by X, ie XC for category.\n\tA '*' is used a wild card string; a '?' is single wild card chr. To\n\t\tsearch for a string\/chr embedded somewhere in a field, uses a '*'\n\t\tbefore and after.\n\tIf embedded spaces are needed in the string-to-be-searched, use an '*'.\n\tNote that the search string is case_insensitive.\n\tBoth the selection file and the main file are scanned completely, so\n\t\tthat one file may be sent to none, one or several destinations\n\t\taccording to the same or different criteriae.\n\nFor the 'type' parameter :\n\t- '$i' refers to the input file name (Note $i is still the FIP\n\t\tSystem Variable 'month')\n\t- all queues and files are assumed to be under \/fip\/spool\n\t- Never assume however that the path environment has been setup, so we advise\n\t\tyou specify full pathnames for the programs.\n\t- all 'type' lines MUST precede the selection - ie be above.\n\t- FIP System variables and Header fields can be accessed.\n\t- there can be one or many or very many type lines.\n\t- any program can be run\n\t- if a script\/program returns an error, it is logged in the Item log and\n\t\tfurther processing stops.\nIf a 'type' exists for a typename, ipstatd will NOT run ipformat but will run\nwhat is specified - which may be ipformat of course.\n\nThe 'trace' parameter is used for setup, tuning and testing a new type. All it\ndoes is tell IPSTATD to log each line in the Item log. EG:\n\ttrace:shares\nTrace MUST always be specified in the DATABASE file BEFORE the types (ie on a\nline nearer the top of the file) and all types must be before the selection\nlines.\n\nThe 'test' parameter does the same as 'trace' BUT NONE of the programs are\nactually run. This allows you just to check syntax etc. EG:\n\ttest:racecards\nTest MUST always be specified in the DATABASE file BEFORE the types (ie on a\nline nearer the top of the file) and all types must be before the selection\nlines.\n\nExample of a sequence of programs for a 'type'. Here, if the file starts\n'borsen', IPFORMAT is strted twice (sequencially, serially - ie NOT at the same\ntime) using two parameter files in tables\/form\/text : WKENDSHARES and\nDAILYSHARES .\n\n; shares : for both weekday and weekend\ntype:shares      ipformat -p dailyshares -i $i\ntype:shares      ipformat -p wkendshares -i $i\n\n; Selection for type called 'shares'\n        SN=borsen*       &gt; shares\n\n\n\ttest:geges\nGoing into the MUI, ip, and doing a 'l' to list the log (or 'm' to more) gives:\nSat Mar  4 11:52:30 ipstatd !i : Incoming File :  geges :   : geges\nSat Mar  4 11:52:30 ipstatd !f : Test\/NotRun : \/fip\/bin\/ipformat -p geges -i\n\/fip\/spool\/form\/geges -D -S NAGS\nSat Mar  4 11:52:30 ipstatd !f : Test\/NotRun : \/fip\/bin\/ipxchg -1 formsave\/NAGS\n-D geges -F -o formsave\nSat Mar  4 11:52:30 ipstatd !f : Test\/NotRun : \/bin\/sort +0 -3 -o\nformsave\/NAGS.done formsave\/NAGS\nSat Mar  4 11:52:30 ipstatd !f : Test\/NotRun : \/bin\/mv formsave\/NAGS.done\n2go\/#SN:geges#DU:nagsdone\n\nOther Points worth noting (ish) ..\n\tBreak out - If either the input parameter -x or a header field FZBO is\npresent, the input file is 'broken apart' into blocks, records and fields. The\nresultant file is called (dest)_(SN) in spool\/formtest where dest is as above\nand SN is the filename.\n\nIf an incoming file matches none of the tests, it is deleted and an error\nlogged.\n\nIn the selection file, remember to specify long names first. In the following\nexample, type 'sunrac2' never gets processed as all files will be typped as\n'sunrac'\n\n\tXK:RAC*\t\t&gt;sunrac\n\tXK:RACING*\t&gt;sunrac2\n\n\n\nInput parameters are (all optional) :\n\t-c : name of a queue into which copies of all incoming files\n\t\tare made.\t\t\t\tdefault: no copies\n\t-f : file creep time\t\t\t\tdefault: 0\n\t-i : queue to scan\t\t\t\tdefault: spool\/2stat\n\t-l : do NOT log every incoming file\/destination\tdefault: log\n\t-n : run the program at reduced priority\tdefault: nice 5\n\t-p : processing file to use\t\tdefault: tables\/stat\/DATABASE\n\t-s : run files serially (ie one after the other) default: parallel\n\t-t : scan time of directory\t\t\tdefault: 3 secs\n\t-T : Always trace types. This is the same as the 'trace' parameter\n\t\tused for setup, tuning and testing a new type. All it does\n\t\tis tell IPSTATD to log each line in the Item log.\tdef: no\n\t-x : debugging ON - ALL incoming files will be 'broken out' in formtest\n\t\tparameter is 'o'ctal, 'd'ecimal or 'h'ex.\tdefault: off\n\t-z : calm down time\t\t\t\tdefault: 5 secs\n\t\tTo attempt to let ipformat finish one type before the next\n\t-v : display version number and exit.\n\n(copyright) 2014 and previous years FingerPost Ltd.\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ipstatd This is the daemon for the statistics database. It uses a parameter file is used to route and process incoming files. This parameter is normally the name of the database to update which is normally the contents of the FipHdr field DB and defaults to tables\/stat\/DATABASE. It first uses a selection table to decide [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":495,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"page-templates\/full-width.php","meta":[],"_links":{"self":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/3363"}],"collection":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/comments?post=3363"}],"version-history":[{"count":0,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/3363\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/pages\/495"}],"wp:attachment":[{"href":"https:\/\/www.fingerpost.co.uk\/wp\/wp-json\/wp\/v2\/media?parent=3363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}