Skip to content
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

How to resolve issues pertaining to import conflicts? #5

Open
bluefangs opened this issue Oct 16, 2021 · 0 comments
Open

How to resolve issues pertaining to import conflicts? #5

bluefangs opened this issue Oct 16, 2021 · 0 comments

Comments

@bluefangs
Copy link

bluefangs commented Oct 16, 2021

I'm trying to import a couple of dashboards as objects.

When I try to import when the imported object is already present in kibana, I run into the below error:

{
    successCount: 0,
    success: False,
    warnings: [],
    errors: [
        { type: "index-pattern", id: "fe7f9fa0-17e1-11ec-a31e-11af02c50652", title: "flows-*", meta: { title: "flows-*", icon: "indexPatternApp" }, error: { type: "conflict" } },
        { type: "search", id: "167356a0-2b48-11ec-b014-9729b774d45b", title: "Forensics-Table", meta: { title: "Forensics-Table", icon: "discoverApp" }, error: { type: "conflict" } },
        { type: "dashboard", id: "48724f10-2ab9-11ec-b6f2-bd65a5fe16d1", title: "Forensics", meta: { title: "Forensics", icon: "dashboardApp" }, error: { type: "conflict" } },
    ],
}

This is the expected behaviour, however, How do I set overwrite: true so that it forces overwrites?

This is my current mechanism to import the dashboard:

kibanaURL = os.environ.get("KIBANA_URL", "localhost:5601")
savedObjects = open(os.path.dirname(os.path.realpath(__file__)) +
                                                '/../config/kibana_saved_objects.ndjson', 'r')
kibana = Kibana(base_url=kibanaURL, username=os.environ.get("ELASTICSEARCH_USERNAME", "elastic"), password=os.environ.get("ELASTICSEARCH_PASSWORD", "elastic"))
response = kibana.object().loads(file=savedObjects)
print(response.json())
savedObjects.close()

This is how elasticsearch has documented resolution of conflicts: Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant