-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kibana/Elasticsearch/Python Setup and Auto-Export #39
Kibana/Elasticsearch/Python Setup and Auto-Export #39
Conversation
…ptForInserting Conflicts: packaging/kibana.spec
documents, doesnt do full Dashboard parsing yet
scripts with some minor tweaking
return asset_title + ".json" | ||
|
||
def get_full_path(asset_id): | ||
global OUTPUT_DIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make this change now, but so many global variables almost warrants this to be a class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I will make a note of that for next time
import elasticsearch | ||
|
||
class Logger: | ||
MAIN_LOG_FORMAT_STR='%(asctime)s.%(msecs)03d %(levelname)s: %(message)s' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you tab with two spaces here but four in other files. Try to keep it consistent, but that can be done in the same PR you make the other file (that Shweta mentioned) a class.
👍 |
|
||
def get_full_path(asset_id): | ||
global OUTPUT_DIR | ||
if OUTPUT_DIR[-1:] == '/': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the colon here. I think OUTPUT_DIR[-1] should work. You can ask Dan or Shweta, they would know better. But if you're trying to get the last element of the list, there shouldn't be a need to splice it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
[MERGE WITH #39] Fixed filters in dashboard
I did these 2 cards in one PR, because I did some refactoring in Stage 2 that effected the code from Stage 1.
setDefaultIndex.py
sets up the index-pattern as[network_]YYYY_MM_DD
and makes it the default index-pattern used by Kibana for displaying metadata info (sidenote: this will be really easy to extend to our other ES index patterns once we decide to open them up like Alex showed in his demo)loadAssets.py
loads all of our dashboards, visualizations, and searches into ES, or updates them if the version in ES is older than the one currently installed on disk.exportAssets.py
is the script used to modify dashboards, visualizations, and searches so that they are exported in the right form for PRs. Just runpython exportAssets.py --help
for info on how it is used.