PERL   56

logxml pl

Guest on 16th August 2022 01:12:53 AM

  1.  
  2. print "<\?xml version='1.0'\?>\n";
  3. print "<LOG>\n";
  4.  
  5.  
  6. while (<>){
  7.  
  8. chomp($_);
  9.  
  10.  
  11. my($id,$ipaddress,$day,$month,$year,$time,$url,$reference,$searchterm,$textfield,$facet,$sort,$expand,$more,$page,$record,$follow,$refine,$seconds,$visit_num,$elapsed,$visit_step,$code,$task) = split("       ",$_);
  12.  
  13.  
  14.  
  15. if (($code eq "SingleTermText") || ($code eq "MultipleTermText") || ($code eq "EmptyTextSearch") || ($code eq "SwitchTextField")){
  16.  
  17.   print"<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>$searchterm</SEARCHTERM>\n<FIELD>$textfield</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  18.  
  19. }
  20.  
  21. if ($code eq "BooleanTextSearch"){
  22.        
  23.         print"<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>$searchterm</SEARCHTERM>\n<FIELD>$textfield</FIELD>\n<FACET>$facet</FACET>\n<REFINE>$refine</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  24. }
  25. if ($code eq "MultipleFieldsText"){
  26.        
  27.  
  28.          print"<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>$searchterm</SEARCHTERM>\n<FIELD>$textfield</FIELD>\n<FACET>$facet</FACET>\n<REFINE>$refine</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  29. }
  30.  
  31.  
  32. if ($code eq "BeginSimpleText"){
  33.    print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  34. }
  35.  
  36. if ($code eq "BeginAdvancedSearch"){
  37.    print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  38. }
  39.  
  40. if ($code eq "BeginNewTitlesSearch"){
  41.    print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  42. }
  43.  
  44. if ($code eq "BeginCallNumberSearch"){
  45.    print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  46. }
  47.  
  48.  
  49.  
  50. if (($code eq "AddFacet")||($code eq "RemoveFacet")){
  51.  
  52.  print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>$facet</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  53.  
  54. }
  55. if ($code eq "RefineYears"){
  56. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>$refine</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  57. }
  58. if (($code eq "OpenFacet")||($code eq "CloseFacet")){
  59.  print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>$expand</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  60.  
  61. }
  62. if ($code eq "ShowMoreFacet"){
  63.  print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>$more</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  64.  
  65. }
  66.  
  67. if ($code eq "NextPage"){
  68. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  69.  
  70.  
  71. }
  72.  
  73. if ($code eq "ViewRecord"){
  74.         print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>$record</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  75.  
  76.  
  77. }
  78.  
  79. if ($code eq "RSS"){
  80. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  81.  
  82.  
  83.  
  84. }
  85.  
  86. if ($code eq "Refresh"){
  87. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  88.  
  89.  
  90.  
  91. }
  92. if ($code eq "FollowupAction"){
  93. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  94.  
  95.  
  96.  
  97. }
  98. if ($code eq "SortResult"){
  99. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  100.  
  101.  
  102.  
  103. }
  104. if ($code eq "ExportService"){
  105. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  106.  
  107.  
  108.  
  109. }
  110. if ($code eq "SelectNewTitles"){
  111. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>$facet</FIELD>\n<FACET>-</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  112.  
  113.  
  114.  
  115. }
  116. if ($code eq "SelectCallNumberRange"){
  117. print "<TRANSACTION>\n<ACTION>$code</ACTION>\n<SEARCHTERM>-</SEARCHTERM>\n<FIELD>-</FIELD>\n<FACET>$facet</FACET>\n<REFINE>-</REFINE>\n<EXPAND>-</EXPAND>\n<MORE>-</MORE>\n<RECORD>-</RECORD>\n<TIME>$elapsed</TIME>\n<VISIT_NUM>$visit_num</VISIT_NUM>\n<VISIT_STEP>$visit_step</VISIT_STEP>\n</TRANSACTION>\n";
  118.  
  119.  
  120.  
  121. }
  122.  
  123.  
  124. }
  125.  
  126. print "</LOG>\n";

Raw Paste


Login or Register to edit or fork this paste. It's free.