Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Archive] IDP: Converting Logs to CSV file generates logs2csv error message



Article ID: KB6339 KB Last Updated: 09 Jun 2010Version: 3.0
IDP: Converting Logs to CSV file generates logs2csv error message
  • logs2csv
  • converting logs to a csv file
  • IDP 2.0
  • management server utilities

Symptoms & Errors:

  • soGetBaseDir(): environment variable IDPDIR not defined
  • soGetBaseDir() failed

On your IDP Management Server, go back to the path /usr/idp/mgt-svr/utils/

Before you run the "log2csv" utility, you must first define the environment variable. To do so type the following: 
export IDPDIR=/usr/idp 
Now, proceed to run the utility (./log2csv -l -f 20030114/0 -t 20030114/700> 20030114.csv ), and it should produce the file "20030114.csv" in the same dir ( /usr/dip/mgt-svr/utils/). Next you will want to send the file to your workstation client for viewing.

Additional Information:

The logs2csv utility will convert traffic logs into .csv and the utility by default ships with the mgt-svr software and it is located at the path: /usr/idp/mgt-svr/utils

Here is the format to run the utility. Use the following syntax:    /usr/idp/mgt-svr/utils/log2csv -l -f yyyymmdd/0 -t yyyymmdd/1000> filename.csv 

yyyy = year 
mm = month 
dd = day 
-l = Print label in the beginning of output specifying column names. 
-f = Specify day id and record id to start query from. 
-t = Specify day id and record id to end query at. 
0 = This is an example of the log record ID # you wish to begin with. 
1000 = This is an example of the log record ID # that you wish to end with. 
filename = Filename of your choice that will end in .csv

Example usage:  /usr/idp/mgt-svr/utils/log2csv -l -f 20020131/0 -t 20020131/200> 20020131.csv

The example command will convert the log for Jan 31, 2002 into a csv format, the spreadsheet will start with log record #0 and end with log record #200, and the file generated will be 20020131.csv   The file will be located in /usr/idp/mgt-svr/utils.  The next step is to export the file to an OS where the file can be opened in MSExcel or imported into another application for viewing, processing or reporting.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search