Pushing of data

Error in pushing of data: raise HTTP_EXCEPTIONS.get(status_code, TransportError)( elasticsearch.exceptions.AuthorizationException: AuthorizationException(403, 'security_exception', 'action [indices:admin/create] is unauthorized for user [guest] with roles [viewer,create_index,manage,all], this action is granted by the index privileges [create_index,manage,all]')
It was pushing the data well and never showed any error. But then I tried to update a filter directly from Kibana and then it started showing this error.
This is the code that i wrote:

const axios = require('axios');

async function updateFilters() {
  try {
    const response = await axios.post(
      '/api/kibana/dashboards/e1af0b80-8285-11ed-8b1c-73fa260fa999/_update_filter',
      {
        // replace e1af0b80-8285-11ed-8b1c-73fa260fa999 with the ID of the dashboard
        filters: [
          {
            query: {
              match_phrase: {
                event: 'lionelmessi'
              }
            }
          }
        ]
      },
      {
        headers: {
          // replace YOUR_API_KEY with your API key
          'kbn-xsrf': 'YOUR_API_KEY'
        }
      }
    );
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

updateFilters();

Can I reset what I did in this code? The pushing of the code through python was happening well but then after I tried this it did not work.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.