You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello Friends,
I would like to search a string in all the Bitbucket server repositories using Rest API.
I can search the code from the Bitbucket Server "Search Box" but it is not possible if there are multiple strings to search and generate a report.
a common use case would be- search all repositories where a common password is exposed.
Is there any Rest API available or could you suggest any workaround?
Thank you
Hi All,
I was able to search a string using ELS Rest api.
this is the the endpoint-
http://<ELSEARCHURL>:9200/bitbucket-search-v1/_search?size=1000&from=0&q=<string-to-search>
eg. if your Bitbucket ELS is hosted on 192.168.10.1 at port 9200 and you would like to search the string "Test"
http://192.168.10.1:9200/bitbucket-search-v1/_search?size=1000&from=0&q=test
please note that it is huge search you need to iterate the loop until search does not find a string.
I wrote a small python program to do that.
https://github.com/inboxamitraj/Bitbucket-Python-Scripts/blob/master/bbsearch.py
Thank you
Hi @amit raj
After upgrade Bitbucket data-center 7.6.0 and upgrade elasticsearch 6.8.6, I'm getting error like below.
Do you have any idea regarding this problem?
{
"error": {
"root_cause": [ {
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_or_alias",
"resource.id": "bitbucket-search-v1",
"index_uuid": "_na_",
"index": "bitbucket-search-v1"
}],
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_or_alias",
"resource.id": "bitbucket-search-v1",
"index_uuid": "_na_",
"index": "bitbucket-search-v1"
},
"status": 404
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Edwin , I think this is only for Bitbucket Cloud, doesn't work for Bitbucket Server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can we use this for Bitbucket server. https://<domain-name>/bitbucket-search-v1/_search?size=1000&from=0&q=test..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think we can do something using elastic search Rest endpoints as Bitbucket usage elastic search behind the scene, working on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes. I was able to search a string using ELS Rest api.
this is the the endpoint-
http://<ELSEARCHURL>:9200/bitbucket-search-v1/_search?size=1000&from=0&q=<string-to-search>
eg. if your Bitbucket ELS is hosted on 192.168.10.1 at port 9200 and you would like to search the string "Test"
http://192.168.10.1:9200/bitbucket-search-v1/_search?size=1000&from=0&q=test
please note that it is huge search you need to iterate the loop until search does not find a string.
I wrote a small python program to do that.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.