Export report through command with filter options or more fileds - coverity

I'm using coverity 8.1. I run the following command to export the coverity report as csv file through command.
/opt/cov-analysis-linux64-8.1.0/bin/cov-manage-im --mode defects --show --stream $cov_stream_cpp --stream $cov_stream_java --host $cov_server --port $cov_port --auth-key-file $cov_auth_file --fields cid,file > ~/Coverity.csv
Is there anyway I can filter the report by Impact? I want to export by High/Medium/Low.
I don't find any option. I also tried to get all fields, but it supports only action, checker, cid, classification, component, ext-ref, file, function, legacy, owner, severity, status, stream-name and nothing else. I wanted to get the Impact also.
How to get it?

it looks like the command:
$ cov-manage-im --mode defects --show --auth-key-file $auth --host $host --port $port --output fields
action
cid
checker
classification
component
ext-ref
file
function
owner
severity
status
legacy
stream-name (stream scope only)
doesn't list the field you want; as far as i can tell you are out of luck

Related

Extracting coverity .csv file from coverity server

How to extract .csv file from Coverity server in command line.
please Explain Command cov-manage-im with example.
Is there any need to install Coverity in Windows, though I have access to the website and can manually download the .csv file
For those who came here looking to export CSV using the web interface to the Coverity server, if you open the menu sidebar, then in the "Issues by ..." and "File" sections, each subsection has a drop-down option "Export CSV" which does the job !
This is clearly explained in Documentation:
Show all defects in 'proj' project
You basically need to use --mode defects to query defects and
--show to output in csv format
cov-manage-im --host <host> --port <port> --user id --password pwd --mode defects --show --project proj
You can add fields as
cov-manage-im --host <host> --port <port> --user id --password pwd --mode defects --show --project proj --fields cid,severity, classification ..
And add filters as
cov-manage-im --host <host> --port <port> --user id --password pwd --mode defects --show --project proj --fields cid,severity, classification .. --status Fixed --class Bug --severity Major ...
and so on and so forth. Just look at detailed documentation on your Coverity Connect instance
As I also needed to download Coverity report as CSV, using the web-ui, I attach here a screenshot, to better explain how this is done.
At the view panel, select the view you want to export (here it is High Impact Outstanding)
now click on the down-arrow and select 'Export CSV'
DC: This is not for command line, this can help when you want to download from server.
I think you can refere this link click
so the basic idea behind this is that first you save a copy of all the issues without any filter( if you want all) then download it.
Solution:-
For any unsaved view (in this case, the view by double clicking on one specific snapshot), if we want to export the result, we need to save this view with a valid name.
click on the gear mark, and check "Save as a Copy".
Provide a name you want, and save the view with OK button.
After that, this view can be accessed via the view list, and can be
exported via "Export to CSV" as other views.

How to backup a specific Monngodb database with date condition

Monngod db
We are creating database daily based on date like ERROR_LOG_12012016.
We now back up on a daily basis when I take dump its done all attached database for here we need to yesterday database only how to do that kindly help this
Regards,
Baskar r
I Think you are looking for this
mongodump --collection myCollection --db test
Based on your comment you should run the cron every day.
Try executing the command in shell script.MongoDump with timestamp
You can use mongoexport
mongoexport -d database_name -c collection_name -o output_file.json
To make it run automatically, follow the below steps
step1: write shell script, Your shell script will be as below,
#!/bin/bash
# My first script
mongoexport -d database_name -c collection_name -o output_file.json
step2: Save the file by name filename
step3: Try running file by command ./filename
step4: Add this command to crontab

mongoexport CSV with out header fields

I have below in a shell script to export certain fields from a mongo collection to a CSV file.
mongoexport --host localhost --db mydb --collection ratings --csv > data.csv --fields userId,filmId,score
My problem is that the result is generated comes with the header values.
ex:
userId,filmId,score
517,533,5
518,534,5
Is there a way that I can generate the csv file with out the header fields?
The mongoexport utility is very spartan and does not support a load of features. Instead the intention is that you augment with other available OS commands or if you really must then create your own code for explicit needs.
But this sample using tail is quite simple to skip the first emitted header line when you consider that all output is going to STDOUT by default anyway:
mongoexport --host localhost --db mydb --collection ratings \
--fields userId,filmId,score \
| tail -n+2 > data.csv
So it is just "piping through" | the tail command with the -n+2 option, that basically says "skip the first line" and then you just redirect > output to the file you want.
Just like most command line utilities, there is no need to build in options that can be performed with other common utilities in such a chained pattern as above. That is why there is no such option built in.
Since version 3.4 you can add --noHeaderLine as option within the command.

Importing a CSV to Mongo on a server

I am having trouble importing a CSV to a MongoDB instance deployed on a server. I was able to use mongoimport to load data to a local instance using the following
mongoimport -d Josh -c diagnosis -- type csv --file\\location\name.csv --headerlin -- ignoreblanks
I have tried to load data to Mongo located on a server through cmd:
C:\Program Files\MongoDB 2.6 Standard\bin>mongoimport --host xxx.xx.x.xxx --db Josh -c diagnosis -- type csv --file\\location\name.csv -- headerline --ignoreblanks
but I get the following error
"Error Parsing Command Line: too many positional options"
What does “too many positional options” mean when doing a mongoexport?
One posting says it is because of black fields in the CSV, however, the --ignoreblanks should take care of blank fields, as it worked on the local instance.
Please add space after --file and no space before type
C:\Program Files\MongoDB 2.6 Standard\bin>mongoimport --host xxx.xx.x.xxx --db Josh -c diagnosis --type csv --file location\name.csv -- headerline --ignoreblanks

MongoDB Export to XSL

How do I export the Collection from Mongo DB to xsl file.
I am using MongoVue export, but it is just displaying the Document and Number of keys in it, but not all the Key and Value pairs in the document..
Please help how to export a mongodb collection to xsl.
I'm not sure of using MongoVue (I haven't used that before) but if you are ok with an extra manual step you could always use mongoexport to output to a CSV file. You can then open and save as XSL via excel.
Here's the syntax for using mongoexport:
mongoexport -d <database> -c <collection> --csv --fields <field1,field2,...> -o <filename>
This will use the localhost mongo instance by defaykt so if you need to connect to another server see the docs:
http://docs.mongodb.org/manual/reference/program/mongoexport/