Export all action to CSV

Hi,

Is there anyone who can help me with exporting all BIGFIX action in CSV format.

I tried Lee Wei’s Action Start End time report but that is so much time consuming & after getting all action copying them manually its really hard.

I heard we can do this with Rest API but dont know how & what type of relevance it use.

I can probably help, but I need to know what you want.

  • What actions do you want to be in the report?
  • All Actions?
  • All Open Actions?
  • All Actions in the last 30 days?
  • What info do you want about each action in the CSV?
  • ID?
  • Name?
  • Taken by?
  • Start/Stop time?
  • What order do you want the info to appear? (column order)

Related:

Thanks @jgstew! Yes i am looking for all actions
All possiable info, like - id, compter name, issued by, issued time, actual issed time on client, end time, actual end time on client, action name, status etc.

And all in cloumn.

For webreport point of view I have already implemented below action start end time but using this webreport is not possible now as we have lots of data which calculation hung the webreport & it keep on calculating for hours- https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014744532#repliesPg=0

Okay, now I’m confused.

Do you want a report on all actions taken by a particular computer, or all actions in total?

You can’t really have a report that gives you info on all actions that also gives you data on the results of those actions from all computers because that is just too much data to process. You might be able to have the time that the very first computer ran the action and the time that the very last computer ran the action or something like that, but you can’t get the results from ALL computers for ALL actions.

You could have a report on all actions with the data about them, then click on a particular action, then see the results from all computers for that specific action.


Can you provide more specific examples of what you want the results to look like? Perhaps screenshots with specifics redacted? Is there a similar view in the console you’d like to replicate?

What is this for? What do you need it for?

This query represents the number of records for all computer results for all actions: number of results of bes actions

That gives me an extremely large number on our production system, and that is just to get the count. Returning actual data would be much slower, and it is already a slow query.

Yes, this is also good but I dont think it can be achieved any csv or xml format.[quote=“jgstew, post:4, topic:19918”]
Can you provide more specific examples of what you want the results to look like? Perhaps screenshots with specifics redacted? Is there a similar view in the console you’d like to replicate?
[/quote]

It could be slimier to lee wee’s custom webreport named as Action start end time but due to huge data it took hours to fetch the desired data but that also incomplete so I was looking something like using curl or restapi we can fetch lager amount of data in very less time & also in xml & csv format.

How I can use this, will this give the details of all actions in csv format.

I don’t know anything about lee wee's custom webreport named as Action start end time

You still aren’t telling me exactly what you want, what you want it to look like, providing any example results you’d like to see. I really can’t help you without more information.

  • How many entries / rows / lines do you expect to be in this CSV file?
  • is it number of actions, which should be in the thousands
  • Or number of action results, which could easily be in the millions?
  • Or is it number of action results by a single computer, which could be just a few to a few hundred?
  • Or is it number of action results by a single action, which could be just a few or up to as many computers as you have total?

Do you want a report that looks something like this?

Once I know what you want to be in the report, then it is a matter of writing session relevance to display that info, which can then be used in the REST API or in Web Reports or in a Console Dashboard, or in many other places. The basic session relevance is the same no matter how or where you access the data or what format you want the data in.


This would also be useful to know to get a better idea of what is possible:

  • How many computers do you have total?
  • How many actions do you have total?

#Try this:

( concatenations ", " of (id of it as string | ""; name of it | ""; name of issuer of it | ""; state of it as string | "") of it) of top level bes actions

How close is this to what you want?

You can test this in a custom webreport by putting it withing <?Relevance ?> or you can do it in the presentation debugger in the bigfix console, or in webreports qna or in the session relevance tester or with the REST API (though I wouldn’t recommend starting with the REST API since it can be harder to debug)


Related:

1 Like

Thanks jgstew for the response !

Please find the screenshot of desired column/info below.

OK I am expecting all data with mentioned column in screen shot, if there could be option to switch between open/stop/expired action.

we have around 17000 endpoints in our infra & having around 1200 variety of actions.[quote=“jgstew, post:6, topic:19918”]
Do you want a report that looks something like this?
[/quote]

This report, I am able to get without any issue from Webreport under Actions tab & also able to export them into csv but this report provide overall info of action not for each one of computer.

I also tried capturing these info with the help of excel connector but that also not giving that much of info.[quote=“jgstew, post:6, topic:19918”]
This would also be useful to know to get a better idea of what is possible:

How many computers do you have total?
How many actions do you have total?
[/quote]

As mentioned above -17000 & around 1200 actions.

I also try this below is the details which I am getting -

Q:( concatenations ", " of (id of it as string | “”; name of it | “”; name of issuer of it | “”; state of it as string | “”) of it) of top level bes actions
A: 4942797, ActionName, OperatorName, Expired

Can we add more in this like, name of computer, date action issued, actual action run date on client, end date of action, actual end of action on client, last report time, if operator selected for reboot or not post action, each client’s action status (fixed/completed/failed/not reported etc.)

Can you tell me what this query returns:

number of results of bes actions

It would also be useful to know how long that takes.

How often do you intend to get this data? Once a week? Once a month?

I think I have an idea of what you are looking for and you can technically get this info from session relevance, but what you seem to be asking for is pretty substantial and significant, potentially containing millions of records unless you limit the scope to only recent actions or something like that.

I’m definitely curious what you intend to do with this data once you have it. Do you just want to archive a record of it?


This should give you something similar to what you are looking for but limited to actions in the past 60 days:

( concatenations ", " of (id of action of it as string; time issued of action of it as string; name of issuer of action of it; name of action of it; name of computer of it; status of it as string & ": " & detailed status of it ) ) of results of top level bes actions whose(now - time issued of it < 60 * day)

More detail could be added to this, but probably not everything you are looking for.

I got this - Q: number of results of bes actions
A: 2603542

I needed this data after every 2 weeks. [quote=“jgstew, post:9, topic:19918”]
I’m definitely curious what you intend to do with this data once you have it. Do you just want to archive a record of it?
[/quote]

Once I have that I need to validate & post that I need to share with concern Team to upload on a another tool for records & availability for everyone who will be having access to that tool.[quote=“jgstew, post:9, topic:19918”]
( concatenations ", " of (id of action of it as string; time issued of action of it as string; name of issuer of action of it; name of action of it; name of computer of it; status of it as string & ": " & detailed status of it ) ) of results of top level bes actions whose(now - time issued of it < 60 * day)
[/quote]

And when I running above relevance I am getting -
E: Singular expression refers to nonexistent object.

I got this relevance which is mapped in one curl query, please have a look on it & suggest what changes I need to make to get all actions data.

Parameter is set to capture period info but I want to capture open/stopped/expired all actions hence can you please help me to modify it.

"relevance=(IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , Names of member actions of actions of it) of results whose ((Name of Action of it as lowercase starts with ""{parameter "periodinfo"}"")) of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , ""Not Reported"" , ""Not Reported"" , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions whose (Name of it as lowercase starts with ""{parameter "periodinfo"}"")" https://myserver:52311/api/query -o c:\temp\{parameter "outfile"}

Hi jgstew, please did you get a chance to look into my shared relevance.

That error indicates that one of the results was missing one of the properties. Could be that the reporting computer was deleted (and no longer has a “computer name”), the issuer has been deleted, or something along those lines. Try error trapping with the pipe operator (|) -

( concatenations ", " of (id of action of it as string | "<unknown>"; time issued of action of it as string | "<unknown>"; name of issuer of action of it | "<unknown>"; name of action of it | "<unknown>"; name of computer of it | "<unknown>"; (status of it as string & ": " & detailed status of it) | "<unknown>" ) ) of results of top level bes actions whose(now - time issued of it < 60 * day)
1 Like

Thanks Jason it worked but I am getting data of action which having not reported computers. Also when I am trying to map it as I am getting error - The system cannot find the file specified.

curl -k --insecure --user ID:pass --data-urlencode "relevance=(concatenations ", " of (id of action of it as string | "<unknown>"; time issued of action of it as string | "<unknown>"; name of issuer of action of it | "<unknown>"; name of action of it | "<unknown>"; name of computer of it | "<unknown>"; (status of it as string & ": " & detailed status of it) | "<unknown>" ) ) of results of top level bes actions whose(now - time issued of it < 60 * day)" https://myserver:52311/api/query -o c:\temp\test.xml

@vk.khurava, we need to be mindful of escaping certain characters for the DOS command line, and some characters for REST API.

For DOS command line, double-quotes need to be escaped with 2 double-quotes.
< > as well.

curl -k --insecure --user ID:pass --data-urlencode "relevance=(concatenations "", "" of (id of action of it as string %%7c ""%%3cunknown%%3c""; time issued of action of it as string %%7c ""%%3cunknown%%3e""; name of issuer of action of it %%7c ""%%3cunknown%%3e""; name of action of it %%7c ""%%3cunknown%%3e""; name of computer of it %%7c ""%%3cunknown%%3e""; (status of it as string & "": "" & detailed status of it) %%7c ""%%3cunknown%%3e"" ) ) of results of top level bes actions whose(now - time issued of it %%3c 60 * day)" https://localhost:52311/api/query -o c:\temp\test.xml
1 Like

Thanks leewei, its working but can you also help with getting not reported servers data by running this relevance.

@leewei - Please help with this relevance if we can get not reported servers details too.

@leewei - Not sure it is related or not, but I have noticed that after upgraded v9.5.3.211 below relevance code is not working under webreport QNA.

Q:(concatenations "; " of (id of action of it as string %%7c “%%3cunknown%%3c”; time issued of action of it as string %%7c “%%3cunknown%%3e”; name of issuer of action of it %%7c “%%3cunknown%%3e”; name of action of it %%7c “%%3cunknown%%3e”; name of computer of it %%7c “%%3cunknown%%3e”; (status of it as string & ": " & detailed status of it) %%7c “%%3cunknown%%3e” ) ) of results of top level bes actions
E: This expression contained a character which is not allowed.

@vk.khurava, I would not have expected this statement to work in QNA.
Remember that we created this statement with the escape code because it is being used from the command line with cURL.

I don’t think the different version of BigFix would have made any difference.

hi leewei,
I am using it that way only in curl but it didnt worked their either hence tested it in qna by removing double quote.