log assertion result in NoN GUI mode[Jmeter] - command-line

How to log assertion result to a csv file in Non Gui mode
i tried command
jmeter -n -t user.jmx -l D:/Reports/TestReport.csv -e -o D:/Reports/htmlReport/ -j Reports/jmeter.log
Assertion result is present in my jmx file but it is not log to any file.

What exactly do you want to "log" and how?
By default JMeter logs assertion failure messages into the .jtl file, there is failureMessage column where all assertion failures go
Demo:
If you don't see this failureMessage column in the .jtl results file most probably you (or somebody else) modified default results file configuration, in order to get the value back add the next line to user.properties file:
jmeter.save.saveservice.assertions=true
and upon JMeter restart you will start seeing assertion results in your .jtl file.
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide

Related

install4j: Installation doesnt create an alternativeLogfile

When i Invoke the installer with:
installerchecker_windows-x64_19_2_1_0-SNAPSHOT.exe
-q
-c
-varfile install.varfile
-Dinstall4j.alternativeLogfile=d:/tmp/logs/installchecker.log
-Dinstall4j.logToStderr=true
it creates and writes the standard log file installation.log in the .install4j Directory, but doesnt create my custom log in d:/tmp/logs. As configured there is an additional error.log with the correct content.
The installation.log shows the comand-line config : install4j.alternativeLogfile=d:/tmp/logs/installchecker.log
The Directory d:/tmp/logs has full access.
Where is the failure in my config ?
The alternative log file is intended to debug situations where the installer fails. To avoid moving the log file to its final destination in .install4j/installation.log, the VM parameter
-Dinstall4j.noPermanentLogFile=true
can be specified.

Informatica Session Failing

I created a mapping that pulls data from a flat file that shows me usage data for specific SSRS reports. The file is overwritten each day with the previous days usage data. My issue is, sometimes the report doesn't have any usage for that day and my ETL sends me a "Failed" email because there wasn't any data in the Source. The job from running if there is no data in the source or to prevent it from failing.
--Thanks
A simple way to solve this is to create a "Passthrough" mapping that only contains a flat file source, source qualifier, and a flat file target.
You would create a session that runs this mapping at the beginning of your workflow and have it read your flat file source. The target can just be a dummy flat file that you keep overwriting. Then you would have this condition in the link to your next session that would actually process the file:
$s_Passthrough.SrcSuccessRows > 0
Yes, there are several ways, you can do this.
You can provide an empty file to ETL job when there is no source data. To do this, use a pre-session command like touch <filename> in the Informatica workflow. This will create an empty file with the <filename> if it is not present. The workflow will run successfully with 0 rows.
If you have a script that triggers the Informatica job, then you can put a check there as well like this:
if [ -e <filename> ]
then
pmcmd ...
fi
This will skip the job from executing.
Have another session before the actual dataload. Read the file, use a FALSE filter and some dummy target. Link this one to the session you already have and set the following link condition:
$yourDummySessionName.SrcSuccessRows > 0

Tool to handle the errors in the error log file

We are developing a script in perl which when gives the url and the webserver to hit. It hits the url given in the webserver and gives the html content of the page.
For example :
perl scribehtml.pl --server servername --port portnumber --url /home/firstpage/index.php
This returns the entire html code of the page.
Now we are grepping the errors from the html code and write in a text file. Say when we see a text like 'Internal server error' we will put the entire html code into the text file.
There by we are going to have a error.txt where all the errors for different urls will be stored when we execute the script.
Now my Questions are :
How to make the error.txt into some log file say error.log and what are things i need to do to make a proper structure log file.
Is there any tool in which if we specify the log file it will parse the error in it and display the count of occurrence of each error in the log file in the dashboard.
As for us now I m storing the list of around 500 urls in a text file and parsing the it one by one and executing so there by i am getting error for the urls which are failing and I m writing those errors in the text file error.txt
Ideally you can make your own subroutine to store the logs in to the .log file.
The default structure for the log file is as following:
[Timestamp]:Error/Warning/Info: String to define the issue
You can format the lines using printf.

how to get particular error logs from diaglog in db2

I am trying the db2diag command to get the all the logs ,captured in diaglog, containing a particular SQLCODE. Can any one help me with the command?
Use the db2diag command and filter the DATA section for "sqlcode" followed by the particular code:
db2diag -g 'data:=sqlcode: -1063' would search for the SQLCODE -1063 (error SQL1063N).
You probably have the full documentation of the db2diag tool. You could then format the output and extract only the part of the log records you need.

How to get rid off Password expiry error message when connecting to Oracle/DB2 Database in solaris shell script/perl program?

I am connecting to Oracle/DB2 databases through shell script/ Perl program. Databases that i am connecting will need password change every 60 days. This is according to our security policy and cannot be changed. But this is creating problem when connecting to Databases through shell script or perl program. To connect to oracle DB we use below through shell script:
sqlplus -s ${USER_NAME}/${PASSWD}#${DATABASE_NAME} <<EOF > $SQL_LOG/SITE_SQL.log
set echo off
set trimspool on
set pages 0
set linesize 1500
set feedback off
set head off
spool ${ETL_DIR}/SITE.txt
select LTRIM(RTRIM(COLUMN1))||'|'||LTRIM(RTRIM(COLUMN2)) from TABLE where COLUMN2 IN (${SITES});
exit
EOF
grep -i 'error' $SQL_LOG/SITE_SQL.log
if [ $? -ne 0 ]
then
echo "\n\n---------------------------->>`date`extraction successful\n\n---------------------------->>" >> $log
else
echo "\n\n---------------------------->>`date` Error with extraction from Table\n\n---------------------------->>" >> $log
exit -5
fi
But SITE_SQL.log which holds the log for database connectivity part is getting below error message in it.
ERROR:
ORA-28002: the password will expire within 13 days
which is making scripts to fail. but connecting happens to Database and we get required data in spool file. When script checks for error in log file SITE_SQL.log its failing. I dont want to change the error handling part but to suppress this message to be displayed/logged into logfile, so that script will not see this error message in logfile.
Also we have got a perl script which is facing same problem.Below is the code used.
my $l_Var_SQL_Statement="Select to_date('$Var_Data_Date_1','YYYY-MM-DD')-max(load_date) from TABLE where LOAD_STATUS='Success'";
$RetVal=SubExecuteSQL($Var_REP_TMP,$Var_USER_DB,$Var_USER_DBUSER,$Var_USER_DBPASSWORD,$l_Var_SQL_Statement);
if($RetVal eq "ERROR") {
$system_date=`date`;
chomp($system_date);
$Message="$system_date:Error Executing Query :$l_Var_SQL_Statement\n$system_date:Database Details:DB=$Var_USER_DB,Use
r ID=$Var_USER_DBUSER, Password= $Var_USER_DBPASSWORD for $my_filename Repository";
SubWriteLogMsg("$Var_REP_LOG","$Var_REP_LOGFILE","$Message");
$Message="Error Executing Query :$l_Var_SQL_Statement. Check log file for connection details.";
SubWriteMailMsg("$Var_INFA_MAILFOLDER","$Var_INFA_MAILFILE","$Message");
SubLogLoadAbort("$Var_REP_LOG","$Var_REP_LOGFILE","$Var_INFA_MAILFOLDER","$Var_INFA_MAILFILE");
exit -1;
}
Here since we are getting the password expiry alert error message SubExecuteSQL function is returning "ERROR" as return value which is making perl script to fail.
DBA's are not agreeing to set password does not expire option as its against security policy. Password is set to change every 60 days. so this error message will start popuping up and causing failure.
Please let me know how can i suppress this error message from getting/ logging into logfile.
Thanks in advance
Before your redirection to the log file, put a grep command in a pipe such as:
| grep -v '^\s*\(ERROR:$\|ORA-\)'
ie:
sqlplus -s ${USER_NAME}/${PASSWD}#${DATABASE_NAME} <<EOF | grep -v '^\s*\(ERROR:|ORA-)' > $SQL_LOG/SITE_SQL.log
Verify first that it works with a sample file: not all versions of grep support \s. If yours does not, use [ \t] instead (yes, the space character must be there, it's not a typo).