Project Created Event

Kota Sreenivasa Shravana Kumar April 7, 2015

Does anyone know, How to get the project created event either through CLI or REST in STASH ?

I just wanted to filer or get the username and time who and when the project was created in STASH.

Appreciate your help.

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Ben Stuart
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 19, 2015

Hello,

I think the easiest method to find project creation events is to grep Stash's logs. If you navigate to <Stash_Home>/log and run the following command:

grep -H -r 'DefaultProjectService Created new project' atlassian-stash*.log

you should get an output similar to this: 

atlassian-stash.log:2015-04-19 13:54:53,662 INFO  [http-nio-7990-exec-10] &lt;USER&gt; @1RYJKG8x834x1177x0 byl6yc 127.0.0.1 "POST /projects HTTP/1.1" c.a.s.i.p.DefaultProjectService Created new project: (&lt;PROJECT_KEY&gt;) &lt;PROJECT_NAME&gt;

For each project created, you will see this line in atlassian-stash.log that contains: Project name, User that created the project, timestamp the project was created and the project key. 

Here is a sample for reference: 

atlassian-stash.log:2015-04-19 13:54:53,662 INFO  [http-nio-7990-exec-10] bstuart @1RYJKG8x834x1177x0 byl6yc 127.0.0.1 "POST /projects HTTP/1.1" c.a.s.i.p.DefaultProjectService Created new project: (CRIT) Critical

 

Hopefully that helps, let me know if you have any further questions!

Regards,
Ben Stuart

Kota Sreenivasa Shravana Kumar April 19, 2015

Thanks Ben. As you know, STASH logs are rolled every day and removed after a month or so. Hence, I will not be able to get the project created event for a project which is older than a month or so. Do you suggest any other approach ? Thanks !

Kota Sreenivasa Shravana Kumar April 22, 2015

I am sorry to ask you another question. Is there a way to search for a source file say 1.java across all repositories across all projects in STASH ? Thanks !

0 votes
Ben Stuart
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2015

If you need to find when all projects were created and by whom navigate to <Stash_Home>/log/audit and run the following command:

zgrep 'ProjectCreatedEvent' *.gz | gawk '{print $5 " - " strftime("%c", $7/1000) " - " $9}'

This will give you an output similar to this: 

bstuart - Sun Apr 19 13:54:53 2015 - CRIT

You may need to download gawk form this website: http://rudix.org/packages/gawk.html

I would also like to add that if you only need to find this information for one project you can do this from the UI as well by going to project settings >> audit log. This is the history of the project and if you go back far enough you should be able to see an entry for when the project was created and by whom. 

Regards,
Ben Stuart

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events