diff --git a/docs/api/saved-objects/find.asciidoc b/docs/api/saved-objects/find.asciidoc index a95cf61ffd749..8a866c9de71d7 100644 --- a/docs/api/saved-objects/find.asciidoc +++ b/docs/api/saved-objects/find.asciidoc @@ -21,6 +21,8 @@ Note: You cannot access this endpoint via the Console in Kibana. (number) The page of objects to return `search` (optional):: (string) A {ref}/query-dsl-simple-query-string-query.html[simple_query_string] Elasticsearch query to filter the objects in the response +`default_search_operator` (optional):: + (string) The default operator to use for the `simple_query_string` `search_fields` (optional):: (array|string) The fields to perform the `simple_query_string` parsed query against `fields` (optional):: diff --git a/docs/apm/bottlenecks.asciidoc b/docs/apm/bottlenecks.asciidoc index 2e06a17555cc7..167d4b81b6c40 100644 --- a/docs/apm/bottlenecks.asciidoc +++ b/docs/apm/bottlenecks.asciidoc @@ -2,25 +2,24 @@ [[apm-bottlenecks]] == Visualizing Application Bottlenecks -Elastic APM monitors transactions and errors in your application. A transaction -can be a request to your server or a batch job or a custom transaction type. -You can see information about response times, requests per minute, and status -codes per endpoint. You can also dive into a specific request sample and get a -complete waterfall view of what your application is spending its time on. For -example, you might see that the bottlenecks are in database queries, cache -calls, or external requests. This information enables you to easily compare and -debug fast responses to slow responses. +Elastic APM captures different types of information from within instrumented applications: -//TBD: What are we wanting them to notice in the following screenshot? -//For example, the APM UI shows that the following transaction is spending over 400 ms querying the orders database? +* {apm-overview-ref-v}/transaction-spans.html[*Spans*] contain information about a specific code path that has been executed. +They measure from the start to end of an activity, +and they can have a parent/child relationship with other spans. +* {apm-overview-ref-v}/transactions.html[*Transactions*] are a special kind of span that have extra metadata associated with them. +You can think of transactions as the highest level of work you’re measuring within a service. +As an example, a transaction could be a request to your server, a batch job, or a custom transaction type. +* {apm-overview-ref-v}/errors.html[*Errors*] contain information about the original exception that occurred or about a log created when the exception occurred. -[role="screenshot"] -image::apm/images/apm-transaction.png[Example view of a transaction in the APM UI in Kibana] +Each of these information types have a specific page associated with them in the APM UI. +These various pages display the captured data in curated charts and tables that allow you to easily compare and debug your applications. -For each incoming request and each application error, you can also see -contextual information such as the request header, user information, system -values, or custom data that you manually attached to the request. +For example, you can see information about response times, requests per minute, and status codes per endpoint. +You can even dive into a specific request sample and get a complete waterfall view of what your application is spending its time on. +You might see that your bottlenecks are in database queries, cache calls, or external requests. +For each incoming request and each application error, +you can also see contextual information such as the request header, user information, +system values, or custom data that you manually attached to the request. -Having access to application-level insights with just a few clicks can -drastically decrease the time you spend debugging errors, slow response times, -and crashes. +Having access to application-level insights with just a few clicks can drastically decrease the time you spend debugging errors, slow response times, and crashes. diff --git a/docs/apm/errors.asciidoc b/docs/apm/errors.asciidoc new file mode 100644 index 0000000000000..e80438975cba0 --- /dev/null +++ b/docs/apm/errors.asciidoc @@ -0,0 +1,46 @@ +[[errors]] +=== Errors overview + +TIP: {apm-overview-ref-v}/errors.html[Errors] are defined as groups of exceptions with matching exception or log messages. + +The *Errors* overview provides a high-level view of the error message and culprit, +the number of occurrences, and the most recent occurrence. +Just like the transaction overview, you'll notice we group together like errors. +This makes it very easy to quickly see which errors are affecting your services, +and to take actions to rectify them. + +[role="screenshot"] +image::apm/images/apm-errors-overview.png[Example view of the errors overview in the APM UI in Kibana] + +Selecting an error group ID or error message brings you to the *Error group*. + +[role="screenshot"] +image::apm/images/apm-error-group.png[Example view of the error group page in the APM UI in Kibana] + +Here, you'll see the error message, culprit, and the number of occurrences over time. + +Further down, you'll see the Error occurrence table. +This is where you can see the details of a sampled error within this group. +The error shown is always the most recent to occur. + +Each error occurrence features a breakdown of the exception, including the stack trace from when the error occurred, +and additional contextual information to help debug the issue. +In some cases, you might also see a Transaction sample ID. +This feature allows you to make a connection between the errors and transactions, +by linking you to the specific transaction where the error occurred. +This allows you to see the whole trace, including which services the request went through. + +[float] +[[errors-alerts-with-watcher]] +==== Error reports with Watcher + +You can use the power of the alerting features with Watcher to get reports on error occurrences. +The Watcher assistant, which is available on the errors overview, can help you set up a watch per service. + +Configure the watch with an occurrences threshold, time interval, and the desired actions, such as email or Slack notifications. +With Watcher, your team can set up reports within minutes. + +Watches are managed separately in the dedicated Watcher UI available in Advanced Settings. + +[role="screenshot"] +image::apm/images/apm-errors-watcher-assistant.png[Example view of the Watcher assistant for errors in APM UI in Kibana] \ No newline at end of file diff --git a/docs/apm/getting-started.asciidoc b/docs/apm/getting-started.asciidoc index 684c420c1e5f5..70ff8849330b2 100644 --- a/docs/apm/getting-started.asciidoc +++ b/docs/apm/getting-started.asciidoc @@ -2,21 +2,20 @@ [[apm-getting-started]] == Getting Started -If you have not already installed and configured Elastic APM, the -**APM > Getting Started** page in {kib} provides information to help you -complete the setup. +If you have not already installed and configured Elastic APM, +the *Setup Instructions* will get you started. [role="screenshot"] -image::apm/images/apm-setup.jpg[Installation instructions on the APM page in Kibana] +image::apm/images/apm-setup.png[Installation instructions on the APM page in Kibana] -After you install the Elastic APM agent library in your application, the -application automatically appears in the APM UI in {kib}. No further -configuration is required. +After you install the Elastic APM agent library in your application, +the application automatically appears in the APM UI in {kib}. +No further configuration is required. -If you also use Elastic Stack for logging and server-level metrics, you can -optionally import the APM dashboards that come with the APM Server. You can use -these APM-specific visualizations to correlate APM data with other data sources. -To get the dashboards, click the "Load Kibana objects" button at the bottom of the Getting Started guides for APM in Kibana. +If you also use the Elastic Stack for logging and server-level metrics, +you can import the APM dashboards that come with the APM Server. +You can use these APM specific visualizations to correlate APM data with other data sources. +To get the dashboards, click *Load Kibana objects* at the bottom of the Setup Instructions. -For more setup information, see -{apm-get-started-ref}/index.html[Getting Started with APM]. +[role="screenshot"] +image::apm/images/apm-setup-dashboards.png[Install dashboards for APM in Kibana] diff --git a/docs/apm/images/apm-distributed-tracing.png b/docs/apm/images/apm-distributed-tracing.png new file mode 100644 index 0000000000000..134797d9039b2 Binary files /dev/null and b/docs/apm/images/apm-distributed-tracing.png differ diff --git a/docs/apm/images/apm-error-group.png b/docs/apm/images/apm-error-group.png index 59c2c4373ff94..0eb691f0c34ee 100644 Binary files a/docs/apm/images/apm-error-group.png and b/docs/apm/images/apm-error-group.png differ diff --git a/docs/apm/images/apm-errors-overview.png b/docs/apm/images/apm-errors-overview.png index 23a921fb7bf61..4e9bf36ee8372 100644 Binary files a/docs/apm/images/apm-errors-overview.png and b/docs/apm/images/apm-errors-overview.png differ diff --git a/docs/apm/images/apm-errors-watcher-assistant.png b/docs/apm/images/apm-errors-watcher-assistant.png index 8666b4b6c14bd..cc71a915ebe76 100644 Binary files a/docs/apm/images/apm-errors-watcher-assistant.png and b/docs/apm/images/apm-errors-watcher-assistant.png differ diff --git a/docs/apm/images/apm-metrics.png b/docs/apm/images/apm-metrics.png new file mode 100644 index 0000000000000..5a306e8e2c36a Binary files /dev/null and b/docs/apm/images/apm-metrics.png differ diff --git a/docs/apm/images/apm-query-bar.png b/docs/apm/images/apm-query-bar.png index f369402d924f6..fa991aef4c998 100644 Binary files a/docs/apm/images/apm-query-bar.png and b/docs/apm/images/apm-query-bar.png differ diff --git a/docs/apm/images/apm-services-overview.png b/docs/apm/images/apm-services-overview.png index 3c8946c131d91..f413a45a47b01 100644 Binary files a/docs/apm/images/apm-services-overview.png and b/docs/apm/images/apm-services-overview.png differ diff --git a/docs/apm/images/apm-services-trace.png b/docs/apm/images/apm-services-trace.png new file mode 100644 index 0000000000000..083c69318e8ed Binary files /dev/null and b/docs/apm/images/apm-services-trace.png differ diff --git a/docs/apm/images/apm-setup-dashboards.png b/docs/apm/images/apm-setup-dashboards.png new file mode 100644 index 0000000000000..86c6e4b24b75f Binary files /dev/null and b/docs/apm/images/apm-setup-dashboards.png differ diff --git a/docs/apm/images/apm-setup.jpg b/docs/apm/images/apm-setup.jpg deleted file mode 100644 index 8d1b84b2855cf..0000000000000 Binary files a/docs/apm/images/apm-setup.jpg and /dev/null differ diff --git a/docs/apm/images/apm-setup.png b/docs/apm/images/apm-setup.png new file mode 100644 index 0000000000000..57e2d85bdfe62 Binary files /dev/null and b/docs/apm/images/apm-setup.png differ diff --git a/docs/apm/images/apm-span-detail.png b/docs/apm/images/apm-span-detail.png index 168151bcbe268..d6fd31de94880 100644 Binary files a/docs/apm/images/apm-span-detail.png and b/docs/apm/images/apm-span-detail.png differ diff --git a/docs/apm/images/apm-traces.png b/docs/apm/images/apm-traces.png new file mode 100644 index 0000000000000..42b7529b5f865 Binary files /dev/null and b/docs/apm/images/apm-traces.png differ diff --git a/docs/apm/images/apm-transaction-detail.png b/docs/apm/images/apm-transaction-detail.png deleted file mode 100644 index 1035fb59945ea..0000000000000 Binary files a/docs/apm/images/apm-transaction-detail.png and /dev/null differ diff --git a/docs/apm/images/apm-transaction-duration-dist.png b/docs/apm/images/apm-transaction-duration-dist.png new file mode 100644 index 0000000000000..cfbac3c7e5783 Binary files /dev/null and b/docs/apm/images/apm-transaction-duration-dist.png differ diff --git a/docs/apm/images/apm-transaction-response-dist.png b/docs/apm/images/apm-transaction-response-dist.png new file mode 100644 index 0000000000000..00e68f6caa841 Binary files /dev/null and b/docs/apm/images/apm-transaction-response-dist.png differ diff --git a/docs/apm/images/apm-transaction-sample.png b/docs/apm/images/apm-transaction-sample.png new file mode 100644 index 0000000000000..7e76f8715004b Binary files /dev/null and b/docs/apm/images/apm-transaction-sample.png differ diff --git a/docs/apm/images/apm-transaction.png b/docs/apm/images/apm-transaction.png index 8ebb641483a41..86b2450efb23e 100644 Binary files a/docs/apm/images/apm-transaction.png and b/docs/apm/images/apm-transaction.png differ diff --git a/docs/apm/images/apm-transactions-overview.png b/docs/apm/images/apm-transactions-overview.png index 0daf24bf49f5f..bdfbf7a61312a 100644 Binary files a/docs/apm/images/apm-transactions-overview.png and b/docs/apm/images/apm-transactions-overview.png differ diff --git a/docs/apm/images/apm-view-full-trace.png b/docs/apm/images/apm-view-full-trace.png new file mode 100644 index 0000000000000..16d69e18a777f Binary files /dev/null and b/docs/apm/images/apm-view-full-trace.png differ diff --git a/docs/apm/images/transaction-icon.png b/docs/apm/images/transaction-icon.png new file mode 100644 index 0000000000000..3534e6915d6cb Binary files /dev/null and b/docs/apm/images/transaction-icon.png differ diff --git a/docs/apm/index.asciidoc b/docs/apm/index.asciidoc index 238f5eff29a01..a3c99a7cc0b89 100644 --- a/docs/apm/index.asciidoc +++ b/docs/apm/index.asciidoc @@ -11,11 +11,16 @@ The **APM** page in {kib} is provided with the basic license. It enables developers to drill down into the performance data for their applications and quickly locate the performance bottlenecks. -For more information about the components of Elastic APM, see -{apm-get-started-ref}/overview.html[APM Overview]. +* <> +* <> +* <> +NOTE: For more information about the components of Elastic APM, +see the {apm-get-started-ref}/overview.html[APM Overview]. -- include::getting-started.asciidoc[] + include::bottlenecks.asciidoc[] + include::using-the-apm-ui.asciidoc[] diff --git a/docs/apm/metrics.asciidoc b/docs/apm/metrics.asciidoc new file mode 100644 index 0000000000000..02d0022f5bf2a --- /dev/null +++ b/docs/apm/metrics.asciidoc @@ -0,0 +1,26 @@ +[[metrics]] +=== Metrics overview + +The *Metrics* overview shows a combination of transaction, error, CPU, and memory data. + +If you're experiencing a problem with your service, you can use this page to attempt to find the underlying cause. +For example, you might be able to correlate a high number of errors with a long transaction duration, high CPU usage, or a memory leak. + +[role="screenshot"] +image::apm/images/apm-metrics.png[Example view of the Metrics overview in APM UI in Kibana] + +[[machine-learning-integration]] +=== Machine Learning integration + +The Machine Learning integration will initiate a new job predefined to calculate anomaly scores on transaction response times. +The response time graph will show the expected bounds and annotate the graph when the anomaly score is 75 or above. + +[role="screenshot"] +image::apm/images/apm-ml-integration.png[Example view of anomaly scores on response times in APM UI in Kibana] + +Jobs can be created per transaction type and based on the average response time. +You can manage jobs in the *Machine Learning jobs management*. +It might take some time for results to appear on the graph. + +Machine learning is a platinum feature. For a comparison of the Elastic license levels, +see https://www.elastic.co/subscriptions[the subscription page]. \ No newline at end of file diff --git a/docs/apm/query-bar.asciidoc b/docs/apm/query-bar.asciidoc new file mode 100644 index 0000000000000..2e33520558042 --- /dev/null +++ b/docs/apm/query-bar.asciidoc @@ -0,0 +1,31 @@ +[[query-bar]] +=== Advanced queries + +The query bar is a powerful data query feature. +Similar to the query bar in {kibana-ref}/discover.html[Discover], +it enables you to pass advanced queries on your data to filter on particular pieces of information that you're interested in. +It comes with a handy autocomplete that helps find the fields and even provides suggestions to the data they include. +You can select the query bar and hit the down arrow on your keyboard to begin seeing recommendations. + +When querying, you're simply searching and selecting data from fields in Elasticsearch documents. +It may be helpful to view some of your documents in {kibana-ref}/discover.html[Discover] to better understand how APM data is stored in Elasticsearch. + +The query bar is available in the Services, Transactions, Errors, Metrics, and Traces views, +and any input will persist as you move between pages. + +TIP: Interactions with the query bar change the URL of the page you're on. +This means you can simply copy and paste the URL of your page to share a specific query or view with others. + +In the screenshot below, you can begin to see some of the transaction fields available for filtering on: + +[role="screenshot"] +image::apm/images/apm-query-bar.png[Example of the Kibana Query bar in APM UI in Kibana] + +==== Example queries + +* Exclude response times slower than 2000 ms: `transaction.duration.us > 2000000` +* Filter by response status code: `context.response.status_code >= 400` +* Filter by single user ID: `context.user.id : 12` +* View _all_ transactions for an endpoint, instead of just a sample - `processor.event: "transaction" AND transaction.name: ""` + +TIP: Read the {kibana-ref}/kuery-query.html[Kibana Query Language Enhancements] documentation to learn more about the capabilities of the {kib} query language. diff --git a/docs/apm/services.asciidoc b/docs/apm/services.asciidoc new file mode 100644 index 0000000000000..4c3c569b2e272 --- /dev/null +++ b/docs/apm/services.asciidoc @@ -0,0 +1,10 @@ +[[services]] +=== Services overview + +The *Services* overview gives you quick insights into the health and general performance of each service. +The <> in {kib} defines which services are available. + +You can add services by setting the `service.name` configuration in each of the {apm-agents-ref}[APM agents] you’re instrumenting. + +[role="screenshot"] +image::apm/images/apm-services-overview.png[Example view of services table the APM UI in Kibana] \ No newline at end of file diff --git a/docs/apm/spans.asciidoc b/docs/apm/spans.asciidoc new file mode 100644 index 0000000000000..a19c3d34e4347 --- /dev/null +++ b/docs/apm/spans.asciidoc @@ -0,0 +1,40 @@ +[[spans]] +=== Span timeline + +TIP: A {apm-overview-ref-v}/transaction-spans.html[span] is defined as the duration of a single event. +Spans are automatically captured by APM agents, and you can also define custom spans. +Each span has a type and is defined by a different color in the timeline/waterfall visualization. + +The span timeline visualization is a bird's-eye view of what your application was doing while it was trying to respond to the request that came in. +This makes it useful for visualizing where the selected transaction spent most of its time. + +[role="screenshot"] +image::apm/images/apm-distributed-tracing.png[Example view of the distributed tracing in APM UI in Kibana] + +View a span in detail by clicking on it in the timeline waterfall. +For example, in the below screenshot we've clicked on an SQL Select database query. +The information displayed includes the actual SQL that was executed, how long it took, +and the percentage of the trace's total time. +You also get a stack trace, which shows the SQL query in your code. +Finally, APM knows which files are your code and which are just modules or libraries that you've installed. +These library frames will be minimized by default in order to show you the most relevant stack trace. + +[role="screenshot"] +image::apm/images/apm-span-detail.png[Example view of a span detail in the APM UI in Kibana] + +If your span timeline is colorful, it's indicative of a <>. +Services in a distributed trace are separated by color and listed in the order they occur. + +[role="screenshot"] +image::apm/images/apm-services-trace.png[Example of distributed trace colors in the APM UI in Kibana] + +Don't forget, a distributed trace includes more than one transaction. +When viewing these distributed traces in the timeline waterfall, you'll see this image:apm/images/transaction-icon.png[APM icon] icon, +which indicates the next transaction in the trace. +These transactions can be expanded and viewed in detail by clicking on them. + +After exploring these traces, +you can return to the full trace by clicking *View full trace* in the upper right hand corner of the page. + +[role="screenshot"] +image::apm/images/apm-view-full-trace.png[Example of distributed trace colors in the APM UI in Kibana] diff --git a/docs/apm/traces.asciidoc b/docs/apm/traces.asciidoc new file mode 100644 index 0000000000000..214b997818503 --- /dev/null +++ b/docs/apm/traces.asciidoc @@ -0,0 +1,36 @@ +[[traces]] +=== Traces overview + +The *Traces* overview displays the entry transaction for all traces in your application. +If you're using <>, this view is key to finding the critical paths within your application. +Transactions with the same name are grouped together and only shown once in this table. + +By default, transactions are sorted by _Impact_. +Impact helps show the most used and slowest endpoints in your service - in other words, +it's the collective amount of pain a specific endpoint is causing your users. +If there's a particular endpoint you're worried about, you can click on it to view the <>. + +[role="screenshot"] +image::apm/images/apm-traces.png[Example view of the Traces overview in APM UI in Kibana] + +[float] +[[distributed-tracing]] +==== Distributed tracing + +Elastic APM supports distributed tracing. +Distributed tracing is a key feature of modern application performance monitoring as application architectures are shifting from monolithic to more distributed, +service-based architectures. + +Distributed tracing allows APM users to automatically trace requests all the way through the service architecture, +and visualize those traces in one single view in the APM UI. +This is accomplished by tracing all of the requests, from the initial web request to your front-end service, +to queries made to your back-end services. +This makes finding possible bottlenecks throughout your application much easier and faster. + +By definition, a distributed trace includes more than one transaction. +You can use the <> to view a waterfall display of all of the transactions from individual services that are connected in a trace. + +[role="screenshot"] +image::apm/images/apm-distributed-tracing.png[Example view of the distributed tracing in APM UI in Kibana] + +TIP: Distributed tracing is supported by all APM agents and there’s no additional configuration needed. \ No newline at end of file diff --git a/docs/apm/transactions.asciidoc b/docs/apm/transactions.asciidoc new file mode 100644 index 0000000000000..07bb2c4cf8eb9 --- /dev/null +++ b/docs/apm/transactions.asciidoc @@ -0,0 +1,90 @@ +[[transactions]] +=== Transaction overview + +TIP: A {apm-overview-ref-v}/transactions.html[transaction] describes an event captured by an Elastic APM agent instrumenting a service. +The APM agents automatically collect performance metrics on HTTP requests, database queries, and much more. + +// Clicking *service* brings you to detail of transaction +Selecting a <> will display all associated *transactions*. +The charts and table on this dashboard display the transaction duration, requests per minute, and a list of transactions for the selected service. + +[role="screenshot"] +image::apm/images/apm-transactions-overview.png[Example view of transactions table in the APM UI in Kibana] + +*Transaction duration* shows the response times for this service and is broken down into average, 95th, and 99th percentile. +If there's a weird spike that you'd like to investigate, +you can simply zoom in on the graph - this will adjust the specific time range, +and all of the data on the page will update accordingly. + +*Requests per minute* is divided into response codes: 2xx, 3xx, 4xx, etc., +and is useful for determining if you're serving more of one code than you typically do. +Like in the Transaction duration graph, you can zoom in on anomalies to further investigate them. + +The table at the bottom is similar to the <> overview and shows the name of each transaction occurring in the selected service. +Transactions with the same name are grouped together and only shown once in this table. +By default, transactions are sorted by _Impact_. +Impact helps show the most used and slowest endpoints in your service - in other words, +it's the collective amount of pain a specific endpoint is causing your users. +If there's a particular endpoint you're worried about, you can click on it to view the <>. + +[IMPORTANT] +==== +The transaction overview will only display helpful information when the transactions in your service are named correctly. + +Elastic APM Agents come with built-in support for popular frameworks out-of-the-box. +However, if you only see one route in the Transaction overview page, or if you have transactions named "unknown route", +it could be a symptom that the agent either wasn't installed correctly or doesn't support your framework. + +For further details, including troubleshooting and custom implementation instructions, +refer to the documentation for each {apm-agents-ref}[APM Agent] you've implemented. +==== + +[[transaction-details]] +==== Transaction details + +Selecting a transaction group will bring you to the *transaction* details. +Transaction details include a high-level overview of the transaction group duration, +requests per minute, and transaction group duration distribution. +It's important to note that all three of these graphs show data from every transaction within the selected transaction group. + +[role="screenshot"] +image::apm/images/apm-transaction-response-dist.png[Example view of response time distribution] + +A single sampled transaction is also displayed. +This sampled transaction is based on your selection in the *Transactions duration distribution*. +You can update the sampled transaction by selecting a new _bucket_ in the transactions duration distribution graph. +The number of requests per bucket is displayed when hovering over the graph, and the selected bucket is highlighted to stand out. + +[role="screenshot"] +image::apm/images/apm-transaction-duration-dist.png[Example view of transactions duration distribution graph] + +Let's look at an example. +In the screenshot below, +you'll notice most of our requests fall into buckets on the left side of the graph, +with a long tail of smaller buckets to the right. +This is a typical distribution, and indicates most of our requests were served quickly - awesome! +It's the requests on the right, the ones taking longer than average, that we probably want to focus on. +By clicking on these buckets, +we're presented with a span timeline waterfall showing what a typical request in that bucket was doing. +By investigating this timeline waterfall, we can hopefully see why it was slow and then implement a fix. + +[role="screenshot"] +image::apm/images/apm-transaction-sample.png[Example view of transactions sample] + +NOTE: More information on timeline waterfalls is available in <>. + +For a particular transaction sample, we can get even more information in the tabs: + +* *Timeline* - See the <> section for more information. +* *Request* - The URL, headers, body, etc.. +* *Response* - The response. +* *System* - The system hostname, architecture, platform, etc.. +* *Service* - The service/application runtime, agent, name, etc.. +* *Process* - The process id that served up the request. +* *User* - This requires additional configuration, but allows you to see which user experienced the current transaction. +This can be extremely useful if it's determined that specific users are getting slow requests. +* *Tags* - Useful if you want to start correlating transactions with log files or metrics from Metricbeat. +* *Custom* - You can configure your agent to add custom contextual information on transactions. + +TIP: All of this data is stored in documents in Elasticsearch. +This means you can select "Actions - View sample document" to see the actual Elasticsearch document under the discover tab. \ No newline at end of file diff --git a/docs/apm/using-the-apm-ui.asciidoc b/docs/apm/using-the-apm-ui.asciidoc index 012f778c3a311..aec8724fa56a8 100644 --- a/docs/apm/using-the-apm-ui.asciidoc +++ b/docs/apm/using-the-apm-ui.asciidoc @@ -1,91 +1,32 @@ [role="xpack"] [[apm-ui]] -== Using the APM UI +== Using APM -The APM UI is designed to be as intuitive as possible, but you might come across certain terms or concepts that don’t feel native to you. Not to worry, that’s why we’ve created this guide to help you get the most out of the solution. +APM is designed to be as intuitive as possible, +but you might come across certain terms or concepts that don’t feel native to you. +Not to worry, we've created this guide to help you get the most out of Elastic APM. -* <> -* <> -* <> -* <> -* <> -* <> -* <> +APM is available via the navigation sidebar in {Kib}. -[[services]] -=== Services +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> -You can add services by setting the `service.name` in the APM agent configuration per service you’re instrumenting. The global time range filter in Kibana defines which services are available. The Services overview gives you a quick insight into the health and general performance of each service. +include::services.asciidoc[] -[role="screenshot"] -image::apm/images/apm-services-overview.png[Example view of services table the APM UI in Kibana] +include::traces.asciidoc[] -[[transactions]] -=== Transactions +include::transactions.asciidoc[] -The APM agents automatically collect performance metrics on HTTP requests, database queries, and much more. Please refer to the documentation for each agent for more detail. Each `transaction.type` is displayed separately to make it easy for you to navigate to the transaction. +include::spans.asciidoc[] -[role="screenshot"] -image::apm/images/apm-transactions-overview.png[Example view of transactions table in the APM UI in Kibana] +include::errors.asciidoc[] -[[spans]] -=== Spans +include::metrics.asciidoc[] -A span is defined as the duration of a single event. Spans are automatically captured by the APM agents, but you can also define custom spans. Each span has a type and is defined by a different colour in the Timeline visualization (also known as the waterfall). - -[role="screenshot"] -image::apm/images/apm-transaction-detail.png[Example view of transactions detail page in the APM UI in Kibana] - -You can view a span in detail by clicking it in the Timeline. This displays the recorded SQL database query or source code (in-app frames) around the event that was captured. - -[role="screenshot"] -image::apm/images/apm-span-detail.png[Example view of a span detail in the APM UI in Kibana] - -[[errors]] -=== Errors - -Errors are defined as groups of exceptions with matching exception or log messages. Each error group features a breakdown of the exception including the stackframes from when the error occurred and additional contextual information to help debug the issue. - -[role="screenshot"] -image::apm/images/apm-errors-overview.png[Example view of the errors overview in the APM UI in Kibana] - -[role="screenshot"] -image::apm/images/apm-error-group.png[Example view of the error group page in the APM UI in Kibana] - -[[errors-alerts-with-watcher]] -=== Errors alerts with Watcher - -You can use the power of the alerting features with Watcher to get alerts on error occurrences. The Watcher assistant, which is available on the Errors overview page, can help you set up a watch per service. - -Configure the watch with occurrences threshold and time interval and set the desired actions, such as email or Slack notifications. Your team can be set up with alerts in minutes. - -Watches are managed separately in the dedicated Watcher UI available in Advanced Settings. - -[role="screenshot"] -image::apm/images/apm-errors-watcher-assistant.png[Example view of the Watcher assistant for errors in APM UI in Kibana] - -[[machine-learning-integration]] -=== Machine Learning integration - -The Machine Learning integration will initiate a new job predefined to calculate anomaly scores on transaction response times. The response time graph will show the expected bounds and annotate the graph when the anomaly score is 75 or above. - -[role="screenshot"] -image::apm/images/apm-ml-integration.png[Example view of anomaly scores on response times in APM UI in Kibana] - -Jobs can be created per transaction type and based on the average response time. You can manage jobs in the Machine Learning jobs management page. It might take some time for results to appear on the graph. - -[[query-bar]] -=== Query bar - -The query bar is a powerful data query feature. Similar to the query bar in {kibana-ref}/discover.html[Discover] it enables you to pass advanced queries on your data to filter on particular pieces of information that you're interested in. It comes with a handy autocomplete that helps find the fields and even provides suggestions to the data they include. The query bar is available on Services, Transaction and Errors views, and any input will persist as you move between them. - -[role="screenshot"] -image::apm/images/apm-query-bar.png[Example of the Kibana Query bar in APM UI in Kibana] - -==== Example queries - -* Exclude response times faster than 2000 ms; `transaction.duration.us > 2000000` -* Filter by response status code; `context.response.status_code >= 400` -* Filter by single user ID; `context.user.id : 12` - -Read the {kibana-ref}/kuery-query.html[Kibana Query Language Enhancements] documentation to learn more about the capabilities in the Kibana query language. \ No newline at end of file +include::query-bar.asciidoc[] \ No newline at end of file diff --git a/docs/migration/migrate_7_0.asciidoc b/docs/migration/migrate_7_0.asciidoc index f97ec0e0b3c8c..7fb2957c22c62 100644 --- a/docs/migration/migrate_7_0.asciidoc +++ b/docs/migration/migrate_7_0.asciidoc @@ -85,6 +85,34 @@ to Kibana's advanced setting. on each Elasticsearch node, Logstash node, Kibana instance, and Beat to collect and index metrics. Each node and instance is considered unique based on its persistent UUID, which is written to the path.data directory when the node or instance starts. +[float] +=== kibana.yml setting `xpack.monitoring.elasticsearch.url` is no longer valid +*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.hosts` should be used instead. +In prior versions of Kibana, if no port was specified in `xpack.monitoring.elasticsearch.url` a default of 9200 was chosen. +The port in `xpack.monitoring.elasticsearch.hosts` is protocol dependent: https ports will use 443, and http ports will use 80. + +*Impact:* Users with `xpack.monitoring.elasticsearch.url` set should use `xpack.monitoring.elasticsearch.hosts` instead and if +`xpack.monitoring.elasticsearch.url` was dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url. + +[float] +=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.cert` is no longer valid +*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.certificate` should be used instead. + +*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.cert` set should use `xpack.monitoring.elasticsearch.ssl.certificate` instead + +[float] +=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.ca` is no longer valid +*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.certificateAuthorities` should be used instead. + +*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.ca` set should use `xpack.monitoring.elasticsearch.ssl.certificateAuthorities` instead + +[float] +=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.verify` is no longer valid +*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.verificationMode` should be used instead. + +*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.verify` set should use `xpack.monitoring.elasticsearch.ssl.verificationMode` instead. +Previously set `xpack.monitoring.elasticsearch.ssl.verify` is equal to `xpack.monitoring.elasticsearch.ssl.verificationMode: full`. + [float] === Deprecated API `/shorten` has been removed *Details:* The `/shorten` API has been deprecated since 6.5, when it was replaced by the `/api/shorten_url` API. @@ -97,13 +125,6 @@ considered unique based on its persistent UUID, which is written to the path.dat *Impact:* The logging.useUTC flag will have to be replaced with a timezone id. If set to true the id is `UTC`. -[float] -=== kibana.yml setting `elasticsearch.url` sets port based on protocol -*Details:* In prior versions of Kibana, if no port was specified in `elasticsearch.url` a default of 9200 was chosen. -The port is now protocol dependent: https ports will use 443, and http ports will use 80. - -*Impact:* If your `elasticsearch.url` was dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url. - [float] === kibana.yml setting `server.ssl.supportedProtocols` excludes TLSv1 by default *Details:* TLSv1 support has been removed by default, it's still possible to opt-in to TLSv1 support by explicitly setting @@ -135,3 +156,31 @@ It's now required that the user sets `server.ssl.enabled` to true for this to oc *Details:* This deprecated setting has been removed and `i18n.locale` should be used instead. *Impact:* Users with `i18n.defaultLocale` set should use `i18n.locale` instead + +[float] +=== kibana.yml setting `elasticsearch.url` is no longer valid +*Details:* This deprecated setting has been removed and `elasticsearch.hosts` should be used instead. +In prior versions of Kibana, if no port was specified in `elasticsearch.url` a default of 9200 was chosen. The port in +`elasticsearch.hosts` is protocol dependent: https ports will use 443, and http ports will use 80. + +*Impact:* Users with `elasticsearch.url` set should use `elasticsearch.hosts` instead and if `elasticsearch.url` was +dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url. + +[float] +=== kibana.yml setting `elasticsearch.ssl.cert` is no longer valid +*Details:* This deprecated setting has been removed and `elasticsearch.ssl.certificate` should be used instead. + +*Impact:* Users with `elasticsearch.ssl.cert` set should use `elasticsearch.ssl.certificate` instead + +[float] +=== kibana.yml setting `elasticsearch.ssl.ca` is no longer valid +*Details:* This deprecated setting has been removed and `elasticsearch.ssl.certificateAuthorities` should be used instead. + +*Impact:* Users with `elasticsearch.ssl.ca` set should use `elasticsearch.ssl.certificateAuthorities` instead + +[float] +=== kibana.yml setting `elasticsearch.ssl.verify` is no longer valid +*Details:* This deprecated setting has been removed and `elasticsearch.ssl.verificationMode` should be used instead. + +*Impact:* Users with `elasticsearch.ssl.verify` set should use `elasticsearch.ssl.verificationMode` instead. +Previously set `elasticsearch.ssl.verify` is equal to `elasticsearch.ssl.verificationMode: full`. diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh index 4c6d0ab6897b7..669cd9cb8859d 100755 --- a/src/dev/ci_setup/setup.sh +++ b/src/dev/ci_setup/setup.sh @@ -29,7 +29,7 @@ fi export KIBANA_DIR="$dir" export XPACK_DIR="$KIBANA_DIR/x-pack" export PARENT_DIR="$(cd "$KIBANA_DIR/.."; pwd)" -export TEST_ES_SNAPSHOT_VERSION="7.0.0-fbd1a09d" + echo "-> KIBANA_DIR $KIBANA_DIR" echo "-> XPACK_DIR $XPACK_DIR" echo "-> PARENT_DIR $PARENT_DIR" diff --git a/src/es_archiver/lib/indices/__tests__/create_index_stream.js b/src/es_archiver/lib/indices/__tests__/create_index_stream.js index 30ae9841649d4..3bf1d74804895 100644 --- a/src/es_archiver/lib/indices/__tests__/create_index_stream.js +++ b/src/es_archiver/lib/indices/__tests__/create_index_stream.js @@ -113,6 +113,7 @@ describe('esArchiver: createCreateIndexStream()', () => { sinon.assert.calledWith(client.indices.create, { method: 'PUT', index: 'index', + include_type_name: false, body: { settings: undefined, mappings: undefined, diff --git a/src/es_archiver/lib/indices/create_index_stream.js b/src/es_archiver/lib/indices/create_index_stream.js index bc965bcc480fe..bd605008ba16d 100644 --- a/src/es_archiver/lib/indices/create_index_stream.js +++ b/src/es_archiver/lib/indices/create_index_stream.js @@ -44,6 +44,9 @@ export function createCreateIndexStream({ client, stats, skipExisting, log, kiba async function handleIndex(record) { const { index, settings, mappings, aliases } = record.value; + // Determine if the mapping belongs to a pre-7.0 instance, for BWC tests, mainly + const isPre7Mapping = !!mappings && Object.keys(mappings).length > 0 && !mappings.properties; + async function attemptToCreate(attemptNumber = 1) { try { if (index.startsWith('.kibana')) { @@ -53,6 +56,7 @@ export function createCreateIndexStream({ client, stats, skipExisting, log, kiba await client.indices.create({ method: 'PUT', index, + include_type_name: isPre7Mapping, body: { settings, mappings, aliases }, }); diff --git a/src/es_archiver/lib/indices/kibana_index.js b/src/es_archiver/lib/indices/kibana_index.js index 379a4078e32b5..1573848564af2 100644 --- a/src/es_archiver/lib/indices/kibana_index.js +++ b/src/es_archiver/lib/indices/kibana_index.js @@ -137,7 +137,7 @@ async function getKibanaStatuses({ kibanaUrl }) { export async function createDefaultSpace({ index, client }) { await client.index({ index, - type: 'doc', + type: '_doc', id: 'space:default', body: { type: 'space', diff --git a/src/legacy/core_plugins/elasticsearch/__tests__/index.js b/src/legacy/core_plugins/elasticsearch/__tests__/index.js deleted file mode 100644 index 3ac93781834d2..0000000000000 --- a/src/legacy/core_plugins/elasticsearch/__tests__/index.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { Deprecations } from '../../../../deprecation'; -import expect from 'expect.js'; -import index from '../index'; -import { noop, set } from 'lodash'; -import sinon from 'sinon'; - -describe('plugins/elasticsearch', function () { - describe('#deprecations()', function () { - let transformDeprecations; - - before(function () { - const Plugin = function (options) { - this.deprecations = options.deprecations; - }; - - const plugin = index({ Plugin }); - - const deprecations = plugin.deprecations(Deprecations); - transformDeprecations = (settings, log = noop) => { - deprecations.forEach(deprecation => deprecation(settings, log)); - }; - }); - - describe('ssl.verificationMode', function () { - let settings; - let sslSettings; - - beforeEach(function () { - settings = {}; - sslSettings = {}; - set(settings, 'ssl', sslSettings); - }); - - it(`sets verificationMode to none when verify is false`, function () { - sslSettings.verify = false; - - transformDeprecations(settings); - expect(sslSettings.verificationMode).to.be('none'); - expect(sslSettings.verify).to.be(undefined); - }); - - it('should log when deprecating verify from false', function () { - sslSettings.verify = false; - - const log = sinon.spy(); - transformDeprecations(settings, log); - expect(log.calledOnce).to.be(true); - }); - - it('sets verificationMode to full when verify is true', function () { - sslSettings.verify = true; - - transformDeprecations(settings); - expect(sslSettings.verificationMode).to.be('full'); - expect(sslSettings.verify).to.be(undefined); - }); - - it('should log when deprecating verify from true', function () { - sslSettings.verify = true; - - const log = sinon.spy(); - transformDeprecations(settings, log); - expect(log.calledOnce).to.be(true); - }); - - it(`shouldn't set verificationMode when verify isn't present`, function () { - transformDeprecations(settings); - expect(sslSettings.verificationMode).to.be(undefined); - }); - - it(`shouldn't log when verify isn't present`, function () { - const log = sinon.spy(); - transformDeprecations(settings, log); - expect(log.called).to.be(false); - }); - }); - }); -}); diff --git a/src/legacy/core_plugins/elasticsearch/index.d.ts b/src/legacy/core_plugins/elasticsearch/index.d.ts index 8f1a1ca1647f7..207ea48dcdf1c 100644 --- a/src/legacy/core_plugins/elasticsearch/index.d.ts +++ b/src/legacy/core_plugins/elasticsearch/index.d.ts @@ -149,7 +149,7 @@ import { export class Cluster { public callWithRequest: CallClusterWithRequest; - public callWithInternalUser: CallClusterWithInternalUser; + public callWithInternalUser: CallCluster; public constructor(config: ClusterConfig); } @@ -376,11 +376,156 @@ export interface CallClusterWithRequest { ): Promise; } -export type CallClusterWithInternalUser = ( - endpoint: string, - clientParams: GenericParams, - options?: CallClusterOptions -) => Promise; +export interface CallCluster { + /* tslint:disable */ + (endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'clearScroll', params: ClearScrollParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'count', params: CountParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'create', params: CreateDocumentParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'delete', params: DeleteDocumentParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'deleteByQuery', params: DeleteDocumentByQueryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'deleteScript', params: DeleteScriptParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'deleteTemplate', params: DeleteTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'exists', params: ExistsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'explain', params: ExplainParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'fieldStats', params: FieldStatsParams, options?: CallClusterOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'get', params: GetParams, options?: CallClusterOptions): Promise>; + (endpoint: 'getScript', params: GetScriptParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'getSource', params: GetSourceParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'getTemplate', params: GetTemplateParams, options?: CallClusterOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'index', params: IndexDocumentParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'info', params: InfoParams, options?: CallClusterOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'mget', params: MGetParams, options?: CallClusterOptions): Promise>; + (endpoint: 'msearch', params: MSearchParams, options?: CallClusterOptions): Promise>; + (endpoint: 'msearchTemplate', params: MSearchTemplateParams, options?: CallClusterOptions): Promise>; + (endpoint: 'mtermvectors', params: MTermVectorsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'ping', params: PingParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'putScript', params: PutScriptParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'putTemplate', params: PutTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'reindex', params: ReindexParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'reindexRethrottle', params: ReindexRethrottleParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'renderSearchTemplate', params: RenderSearchTemplateParams, options?: CallClusterOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'scroll', params: ScrollParams, options?: CallClusterOptions): Promise>; + (endpoint: 'search', params: SearchParams, options?: CallClusterOptions): Promise>; + (endpoint: 'searchShards', params: SearchShardsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'searchTemplate', params: SearchTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'suggest', params: SuggestParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'termvectors', params: TermvectorsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'update', params: UpdateDocumentParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'updateByQuery', params: UpdateDocumentByQueryParams, options?: CallClusterOptions): ReturnType; + + // cat namespace + (endpoint: 'cat.aliases', params: CatAliasesParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.allocation', params: CatAllocationParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.count', params: CatAllocationParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.fielddata', params: CatFielddataParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.health', params: CatHealthParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.help', params: CatHelpParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.indices', params: CatIndicesParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.master', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.nodeattrs', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.nodes', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.pendingTasks', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.plugins', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.recovery', params: CatRecoveryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.repositories', params: CatCommonParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.segments', params: CatSegmentsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.shards', params: CatShardsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.snapshots', params: CatSnapshotsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.tasks', params: CatTasksParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cat.threadPool', params: CatThreadPoolParams, options?: CallClusterOptions): ReturnType; + + // cluster namespace + (endpoint: 'cluster.allocationExplain', params: ClusterAllocationExplainParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.getSettings', params: ClusterGetSettingsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.health', params: ClusterHealthParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.pendingTasks', params: ClusterPendingTasksParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.putSettings', params: ClusterPutSettingsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.reroute', params: ClusterRerouteParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.state', params: ClusterStateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'cluster.stats', params: ClusterStatsParams, options?: CallClusterOptions): ReturnType; + + // indices namespace + (endpoint: 'indices.analyze', params: IndicesAnalyzeParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.clearCache', params: IndicesClearCacheParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.close', params: IndicesCloseParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.create', params: IndicesCreateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.delete', params: IndicesDeleteParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.deleteAlias', params: IndicesDeleteAliasParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.deleteTemplate', params: IndicesDeleteTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.exists', params: IndicesExistsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.existsAlias', params: IndicesExistsAliasParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.existsTemplate', params: IndicesExistsTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.existsType', params: IndicesExistsTypeParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.flush', params: IndicesFlushParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.flushSynced', params: IndicesFlushSyncedParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.forcemerge', params: IndicesForcemergeParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.get', params: IndicesGetParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getAlias', params: IndicesGetAliasParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getFieldMapping', params: IndicesGetFieldMappingParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getMapping', params: IndicesGetMappingParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getSettings', params: IndicesGetSettingsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getTemplate', params: IndicesGetTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.getUpgrade', params: IndicesGetUpgradeParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.open', params: IndicesOpenParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.putAlias', params: IndicesPutAliasParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.putMapping', params: IndicesPutMappingParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.putSettings', params: IndicesPutSettingsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.putTemplate', params: IndicesPutTemplateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.recovery', params: IndicesRecoveryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.refresh', params: IndicesRefreshParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.rollover', params: IndicesRolloverParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.segments', params: IndicesSegmentsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.shardStores', params: IndicesShardStoresParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.shrink', params: IndicesShrinkParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.stats', params: IndicesStatsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.updateAliases', params: IndicesUpdateAliasesParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.upgrade', params: IndicesUpgradeParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'indices.validateQuery', params: IndicesValidateQueryParams, options?: CallClusterOptions): ReturnType; + + // ingest namepsace + (endpoint: 'ingest.deletePipeline', params: IngestDeletePipelineParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'ingest.getPipeline', params: IngestGetPipelineParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'ingest.putPipeline', params: IngestPutPipelineParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'ingest.simulate', params: IngestSimulateParams, options?: CallClusterOptions): ReturnType; + + // nodes namespace + (endpoint: 'nodes.hotThreads', params: NodesHotThreadsParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'nodes.info', params: NodesInfoParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'nodes.stats', params: NodesStatsParams, options?: CallClusterOptions): ReturnType; + + // snapshot namespace + (endpoint: 'snapshot.create', params: SnapshotCreateParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.createRepository', params: SnapshotCreateRepositoryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.delete', params: SnapshotDeleteParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.deleteRepository', params: SnapshotDeleteRepositoryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.get', params: SnapshotGetParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.getRepository', params: SnapshotGetRepositoryParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.restore', params: SnapshotRestoreParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.status', params: SnapshotStatusParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'snapshot.verifyRepository', params: SnapshotVerifyRepositoryParams, options?: CallClusterOptions): ReturnType; + + // tasks namespace + (endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType; + (endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType; + /* tslint:enable */ + + // other APIs accessed via transport.request + (endpoint: 'transport.request', clientParams: AssistantAPIClientParams, options?: {}): Promise< + AssistanceAPIResponse + >; + (endpoint: 'transport.request', clientParams: DeprecationAPIClientParams, options?: {}): Promise< + DeprecationAPIResponse + >; + + // Catch-all definition + (endpoint: string, clientParams: any, options?: CallClusterOptions): Promise; +} export interface ElasticsearchPlugin { ElasticsearchClientLogging: ElasticsearchClientLogging; diff --git a/src/legacy/core_plugins/elasticsearch/index.js b/src/legacy/core_plugins/elasticsearch/index.js index 8c1426a4560f4..70583783e0cd8 100644 --- a/src/legacy/core_plugins/elasticsearch/index.js +++ b/src/legacy/core_plugins/elasticsearch/index.js @@ -17,9 +17,6 @@ * under the License. */ -import { compact, get, has, set } from 'lodash'; -import { unset } from '../../../utils'; - import healthCheck from './lib/health_check'; import { createDataCluster } from './lib/create_data_cluster'; import { createAdminCluster } from './lib/create_admin_cluster'; @@ -67,52 +64,6 @@ export default function (kibana) { }).default(); }, - deprecations({ rename }) { - const sslVerify = (basePath) => { - const getKey = (path) => { - return compact([basePath, path]).join('.'); - }; - - return (settings, log) => { - const sslSettings = get(settings, getKey('ssl')); - - if (!has(sslSettings, 'verify')) { - return; - } - - const verificationMode = get(sslSettings, 'verify') ? 'full' : 'none'; - set(sslSettings, 'verificationMode', verificationMode); - unset(sslSettings, 'verify'); - - log(`Config key "${getKey('ssl.verify')}" is deprecated. It has been replaced with "${getKey('ssl.verificationMode')}"`); - }; - }; - - const url = () => { - return (settings, log) => { - const deprecatedUrl = get(settings, 'url'); - const hosts = get(settings, 'hosts.length'); - if (!deprecatedUrl) { - return; - } - if (hosts) { - log('Deprecated config key "elasticsearch.url" conflicts with "elasticsearch.hosts". Ignoring "elasticsearch.url"'); - } else { - set(settings, 'hosts', [deprecatedUrl]); - log('Config key "elasticsearch.url" is deprecated. It has been replaced with "elasticsearch.hosts"'); - } - unset(settings, 'url'); - }; - }; - - return [ - rename('ssl.ca', 'ssl.certificateAuthorities'), - rename('ssl.cert', 'ssl.certificate'), - url(), - sslVerify(), - ]; - }, - uiExports: { injectDefaultVars(server, options) { return { diff --git a/src/legacy/core_plugins/inspector_views/public/requests/details/req_details_stats.js b/src/legacy/core_plugins/inspector_views/public/requests/details/req_details_stats.js index 6a2497ec971cb..1a585d2ceefbb 100644 --- a/src/legacy/core_plugins/inspector_views/public/requests/details/req_details_stats.js +++ b/src/legacy/core_plugins/inspector_views/public/requests/details/req_details_stats.js @@ -35,7 +35,7 @@ class RequestDetailsStats extends Component { renderStatRow = (stat) => { return [ @@ -55,7 +55,7 @@ class RequestDetailsStats extends Component { /> } - {stat.name} + {stat.label} {stat.value} @@ -64,7 +64,7 @@ class RequestDetailsStats extends Component { render() { const { stats } = this.props.request; - const sortedStats = Object.keys(stats).sort().map(name => ({ name, ...stats[name] })); + const sortedStats = Object.keys(stats).sort().map(id => ({ id, ...stats[id] })); // TODO: Replace by property once available return ( (key: string): T; @@ -31,6 +32,7 @@ declare module 'hapi' { interface PluginProperties { elasticsearch: ElasticsearchPlugin; kibana: any; + spaces: any; // add new plugin types here } @@ -41,11 +43,9 @@ declare module 'hapi' { } interface Request { - getBasePath: () => string; - } - - interface Request { - getUiSettingsService: () => any; + getSavedObjectsClient(): SavedObjectsClient; + getBasePath(): string; + getUiSettingsService(): any; } } diff --git a/src/server/mappings/index.js b/src/server/mappings/index.js index d40fe13b1bed3..c14e222336a0b 100644 --- a/src/server/mappings/index.js +++ b/src/server/mappings/index.js @@ -19,7 +19,6 @@ export { getTypes, - getRootType, getProperty, getRootProperties, getRootPropertiesObjects, diff --git a/src/server/mappings/lib/get_property.js b/src/server/mappings/lib/get_property.js index d71c97b9185b7..e6311abdf61c7 100644 --- a/src/server/mappings/lib/get_property.js +++ b/src/server/mappings/lib/get_property.js @@ -19,8 +19,6 @@ import toPath from 'lodash/internal/toPath'; -import { getRootType } from './get_root_type'; - /** * Recursively read properties from the mapping object of type "object" * until the `path` is resolved. @@ -53,7 +51,7 @@ function getPropertyMappingFromObjectMapping(mapping, path) { */ export function getProperty(mappings, path) { return getPropertyMappingFromObjectMapping( - mappings[getRootType(mappings)], + mappings, toPath(path) ); } diff --git a/src/server/mappings/lib/get_property.test.js b/src/server/mappings/lib/get_property.test.js index cf460e58fd752..2f41ecae0e653 100644 --- a/src/server/mappings/lib/get_property.test.js +++ b/src/server/mappings/lib/get_property.test.js @@ -20,26 +20,24 @@ import { getProperty } from './get_property'; const MAPPINGS = { - rootType: { - properties: { - foo: { - properties: { - name: { - type: 'text' - }, - description: { - type: 'text' - } + properties: { + foo: { + properties: { + name: { + type: 'text' + }, + description: { + type: 'text' } - }, - bar: { - properties: { - baz: { - type: 'text', - fields: { - box: { - type: 'keyword' - } + } + }, + bar: { + properties: { + baz: { + type: 'text', + fields: { + box: { + type: 'keyword' } } } @@ -58,28 +56,28 @@ function runTest(key, mapping) { describe('getProperty(mappings, path)', () => { describe('string key', () => { it('finds root properties', () => { - runTest('foo', MAPPINGS.rootType.properties.foo); + runTest('foo', MAPPINGS.properties.foo); }); it('finds nested properties', () => { - runTest('foo.name', MAPPINGS.rootType.properties.foo.properties.name); - runTest('foo.description', MAPPINGS.rootType.properties.foo.properties.description); - runTest('bar.baz', MAPPINGS.rootType.properties.bar.properties.baz); + runTest('foo.name', MAPPINGS.properties.foo.properties.name); + runTest('foo.description', MAPPINGS.properties.foo.properties.description); + runTest('bar.baz', MAPPINGS.properties.bar.properties.baz); }); it('finds nested multi-fields', () => { - runTest('bar.baz.box', MAPPINGS.rootType.properties.bar.properties.baz.fields.box); + runTest('bar.baz.box', MAPPINGS.properties.bar.properties.baz.fields.box); }); }); describe('array of string keys', () => { it('finds root properties', () => { - runTest(['foo'], MAPPINGS.rootType.properties.foo); + runTest(['foo'], MAPPINGS.properties.foo); }); it('finds nested properties', () => { - runTest(['foo', 'name'], MAPPINGS.rootType.properties.foo.properties.name); - runTest(['foo', 'description'], MAPPINGS.rootType.properties.foo.properties.description); - runTest(['bar', 'baz'], MAPPINGS.rootType.properties.bar.properties.baz); + runTest(['foo', 'name'], MAPPINGS.properties.foo.properties.name); + runTest(['foo', 'description'], MAPPINGS.properties.foo.properties.description); + runTest(['bar', 'baz'], MAPPINGS.properties.bar.properties.baz); }); it('finds nested multi-fields', () => { - runTest(['bar', 'baz', 'box'], MAPPINGS.rootType.properties.bar.properties.baz.fields.box); + runTest(['bar', 'baz', 'box'], MAPPINGS.properties.bar.properties.baz.fields.box); }); }); }); diff --git a/src/server/mappings/lib/get_root_properties.js b/src/server/mappings/lib/get_root_properties.js index 7e99f94d38f86..9baffd179a983 100644 --- a/src/server/mappings/lib/get_root_properties.js +++ b/src/server/mappings/lib/get_root_properties.js @@ -17,8 +17,6 @@ * under the License. */ -import { getRootType } from './get_root_type'; - /** * Get the property mappings for the root type in the EsMappingsDsl * @@ -34,12 +32,10 @@ import { getRootType } from './get_root_type'; * This data can be found at `{indexName}.mappings.{typeName}.properties` * in the es indices.get() response. * - * @param {EsMappingsDsl} mappings + * @param {EsMappingsDsl} mapping * @return {EsPropertyMappings} */ -export function getRootProperties(mappings) { - const mapping = mappings[getRootType(mappings)]; - +export function getRootProperties(mapping) { if (mapping.type !== 'object' && !mapping.properties) { throw new TypeError('Unable to get property names non-object root mapping'); } diff --git a/src/server/mappings/lib/get_root_properties_objects.test.js b/src/server/mappings/lib/get_root_properties_objects.test.js index 6b193bdaca262..536bfd9af2845 100644 --- a/src/server/mappings/lib/get_root_properties_objects.test.js +++ b/src/server/mappings/lib/get_root_properties_objects.test.js @@ -21,11 +21,9 @@ import { getRootPropertiesObjects } from './get_root_properties_objects'; test(`returns single object with properties`, () => { const mappings = { - rootType: { - properties: { - foo: { - properties: {} - } + properties: { + foo: { + properties: {} } } }; @@ -40,11 +38,9 @@ test(`returns single object with properties`, () => { test(`returns single object with type === 'object'`, () => { const mappings = { - rootType: { - properties: { - foo: { - type: 'object' - } + properties: { + foo: { + type: 'object' } } }; @@ -59,14 +55,12 @@ test(`returns single object with type === 'object'`, () => { test(`returns two objects with properties`, () => { const mappings = { - rootType: { - properties: { - foo: { - properties: {} - }, - bar: { - properties: {} - } + properties: { + foo: { + properties: {} + }, + bar: { + properties: {} } } }; @@ -84,14 +78,12 @@ test(`returns two objects with properties`, () => { test(`returns two objects with type === 'object'`, () => { const mappings = { - rootType: { - properties: { - foo: { - type: 'object' - }, - bar: { - type: 'object' - } + properties: { + foo: { + type: 'object' + }, + bar: { + type: 'object' } } }; @@ -109,11 +101,9 @@ test(`returns two objects with type === 'object'`, () => { test(`excludes objects without properties and type of keyword`, () => { const mappings = { - rootType: { - properties: { - foo: { - type: 'keyword' - } + properties: { + foo: { + type: 'keyword' } } }; @@ -124,14 +114,12 @@ test(`excludes objects without properties and type of keyword`, () => { test(`excludes two objects without properties and type of keyword`, () => { const mappings = { - rootType: { - properties: { - foo: { - type: 'keyword' - }, - bar: { - type: 'keyword' - } + properties: { + foo: { + type: 'keyword' + }, + bar: { + type: 'keyword' } } }; @@ -142,14 +130,12 @@ test(`excludes two objects without properties and type of keyword`, () => { test(`includes one object with properties and excludes one object without properties`, () => { const mappings = { - rootType: { - properties: { - foo: { - properties: {} - }, - bar: { - type: 'keyword' - } + properties: { + foo: { + properties: {} + }, + bar: { + type: 'keyword' } } }; @@ -164,14 +150,12 @@ test(`includes one object with properties and excludes one object without proper test(`includes one object with type === 'object' and excludes one object without properties`, () => { const mappings = { - rootType: { - properties: { - foo: { - type: 'object' - }, - bar: { - type: 'keyword' - } + properties: { + foo: { + type: 'object' + }, + bar: { + type: 'keyword' } } }; diff --git a/src/server/mappings/lib/get_root_type.js b/src/server/mappings/lib/get_root_type.js deleted file mode 100644 index 4c861e2a1d915..0000000000000 --- a/src/server/mappings/lib/get_root_type.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { getTypes } from './get_types'; - -/** - * Get the singular root type in the EsMappingsDsl - * object. If there are no types, or there are more - * that one type, this function will throw an error. - * - * @param {EsMappingsDsl} mappings - * @return {string} - */ -export function getRootType(mappings) { - const allTypes = getTypes(mappings); - - if (allTypes.length !== 1) { - throw new TypeError(`Unable to get root type of mappings object with ${allTypes.length} root types.`); - } - - return allTypes[0]; -} diff --git a/src/server/mappings/lib/index.js b/src/server/mappings/lib/index.js index 9cbe8d56e2372..f7561c25dbf65 100644 --- a/src/server/mappings/lib/index.js +++ b/src/server/mappings/lib/index.js @@ -19,6 +19,5 @@ export { getProperty } from './get_property'; export { getTypes } from './get_types'; -export { getRootType } from './get_root_type'; export { getRootProperties } from './get_root_properties'; export { getRootPropertiesObjects } from './get_root_properties_objects'; diff --git a/src/server/sample_data/routes/install.js b/src/server/sample_data/routes/install.js index 13111bd6775bc..9a12691774a73 100644 --- a/src/server/sample_data/routes/install.js +++ b/src/server/sample_data/routes/install.js @@ -113,9 +113,7 @@ export const createInstallRoute = () => ({ } }, mappings: { - _doc: { - properties: dataIndexConfig.fields - } + properties: dataIndexConfig.fields } } }; diff --git a/src/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap b/src/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap index d16f9feecb9c0..156c5fa6887f4 100644 --- a/src/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap +++ b/src/server/saved_objects/migrations/core/__snapshots__/build_active_mappings.test.ts.snap @@ -2,36 +2,34 @@ exports[`buildActiveMappings combines all mappings and includes core mappings 1`] = ` Object { - "doc": Object { - "dynamic": "strict", - "properties": Object { - "aaa": Object { - "type": "text", - }, - "bbb": Object { - "type": "long", - }, - "config": Object { - "dynamic": "true", - "properties": Object { - "buildNum": Object { - "type": "keyword", - }, + "dynamic": "strict", + "properties": Object { + "aaa": Object { + "type": "text", + }, + "bbb": Object { + "type": "long", + }, + "config": Object { + "dynamic": "true", + "properties": Object { + "buildNum": Object { + "type": "keyword", }, }, - "migrationVersion": Object { - "dynamic": "true", - "type": "object", - }, - "namespace": Object { - "type": "keyword", - }, - "type": Object { - "type": "keyword", - }, - "updated_at": Object { - "type": "date", - }, + }, + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "namespace": Object { + "type": "keyword", + }, + "type": Object { + "type": "keyword", + }, + "updated_at": Object { + "type": "date", }, }, } diff --git a/src/server/saved_objects/migrations/core/__snapshots__/elastic_index.test.ts.snap b/src/server/saved_objects/migrations/core/__snapshots__/elastic_index.test.ts.snap index 17db6cbe1df41..76bcc6ee219d9 100644 --- a/src/server/saved_objects/migrations/core/__snapshots__/elastic_index.test.ts.snap +++ b/src/server/saved_objects/migrations/core/__snapshots__/elastic_index.test.ts.snap @@ -9,7 +9,6 @@ Array [ "index": Object { "_id": "niceguy:fredrogers", "_index": ".myalias", - "_type": "doc", }, }, Object { @@ -25,7 +24,6 @@ Array [ "index": Object { "_id": "badguy:rickygervais", "_index": ".myalias", - "_type": "doc", }, }, Object { diff --git a/src/server/saved_objects/migrations/core/build_active_mappings.ts b/src/server/saved_objects/migrations/core/build_active_mappings.ts index cc1fe77945d99..156f47faecd56 100644 --- a/src/server/saved_objects/migrations/core/build_active_mappings.ts +++ b/src/server/saved_objects/migrations/core/build_active_mappings.ts @@ -39,10 +39,8 @@ export function buildActiveMappings({ }): IndexMapping { const mapping = defaultMapping(); return _.cloneDeep({ - doc: { - ...mapping.doc, - properties: validateAndMerge(mapping.doc.properties, properties), - }, + ...mapping, + properties: validateAndMerge(mapping.properties, properties), }); } @@ -53,30 +51,28 @@ export function buildActiveMappings({ */ function defaultMapping(): IndexMapping { return { - doc: { - dynamic: 'strict', - properties: { - config: { - dynamic: 'true', - properties: { - buildNum: { - type: 'keyword', - }, + dynamic: 'strict', + properties: { + config: { + dynamic: 'true', + properties: { + buildNum: { + type: 'keyword', }, }, - migrationVersion: { - dynamic: 'true', - type: 'object', - }, - type: { - type: 'keyword', - }, - namespace: { - type: 'keyword', - }, - updated_at: { - type: 'date', - }, + }, + migrationVersion: { + dynamic: 'true', + type: 'object', + }, + type: { + type: 'keyword', + }, + namespace: { + type: 'keyword', + }, + updated_at: { + type: 'date', }, }, }; diff --git a/src/server/saved_objects/migrations/core/call_cluster.ts b/src/server/saved_objects/migrations/core/call_cluster.ts index 0b388229834bf..7b0f496242853 100644 --- a/src/server/saved_objects/migrations/core/call_cluster.ts +++ b/src/server/saved_objects/migrations/core/call_cluster.ts @@ -30,12 +30,11 @@ export interface CallCluster { (path: 'indices.create' | 'indices.delete', opts: IndexCreationOpts): Promise; (path: 'indices.exists', opts: IndexOpts): Promise; (path: 'indices.existsAlias', opts: { name: string }): Promise; - (path: 'indices.get', opts: IndicesGetOptions): Promise; + (path: 'indices.get', opts: IndexOpts & Ignorable): Promise; (path: 'indices.getAlias', opts: { name: string } & Ignorable): Promise; (path: 'indices.getMapping', opts: IndexOpts): Promise; (path: 'indices.getSettings', opts: IndexOpts): Promise; (path: 'indices.putMapping', opts: PutMappingOpts): Promise; - (path: 'indices.putTemplate', opts: PutTemplateOpts): Promise; (path: 'indices.refresh', opts: IndexOpts): Promise; (path: 'indices.updateAliases', opts: UpdateAliasesOpts): Promise; (path: 'reindex', opts: ReindexOpts): Promise; @@ -60,26 +59,11 @@ export interface CountOpts { query: object; }; index: string; - type: string; } export interface PutMappingOpts { - body: DocMapping; + body: IndexMapping; index: string; - type: string; - include_type_name?: boolean; -} - -export interface PutTemplateOpts { - name: string; - body: { - template: string; - settings: { - number_of_shards: number; - auto_expand_replicas: string; - }; - mappings: IndexMapping; - }; } export interface IndexOpts { @@ -88,7 +72,6 @@ export interface IndexOpts { export interface IndexCreationOpts { index: string; - include_type_name?: boolean; body?: { mappings?: IndexMapping; settings?: { @@ -129,10 +112,6 @@ export interface ScrollOpts { scrollId: string; } -export interface IndicesGetOptions extends IndexOpts, Ignorable { - include_type_name?: boolean; -} - /////////////////////////////////////////////////////////////////// // callCluster result type definitions /////////////////////////////////////////////////////////////////// @@ -210,11 +189,7 @@ export interface MappingProperties { [type: string]: any; } -export interface DocMapping { +export interface IndexMapping { dynamic: string; properties: MappingProperties; } - -export interface IndexMapping { - doc: DocMapping; -} diff --git a/src/server/saved_objects/migrations/core/determine_migration_action.test.ts b/src/server/saved_objects/migrations/core/determine_migration_action.test.ts index 7516d17fd5e74..d4491c4525d2c 100644 --- a/src/server/saved_objects/migrations/core/determine_migration_action.test.ts +++ b/src/server/saved_objects/migrations/core/determine_migration_action.test.ts @@ -22,25 +22,21 @@ import { determineMigrationAction, MigrationAction } from './determine_migration describe('determineMigrationAction', () => { test('requires no action if mappings are identical', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - hello: { - properties: { - name: { type: 'text' }, - }, + dynamic: 'strict', + properties: { + hello: { + properties: { + name: { type: 'text' }, }, }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - hello: { - properties: { - name: { type: 'text' }, - }, + dynamic: 'strict', + properties: { + hello: { + properties: { + name: { type: 'text' }, }, }, }, @@ -51,21 +47,17 @@ describe('determineMigrationAction', () => { test('requires no action if mappings differ only by dynamic properties', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - hello: { dynamic: true, foo: 'bar' }, - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + hello: { dynamic: true, foo: 'bar' }, + world: { baz: 'bing' }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - hello: { dynamic: 'true', goober: 'pea' }, - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + hello: { dynamic: 'true', goober: 'pea' }, + world: { baz: 'bing' }, }, }; @@ -74,21 +66,17 @@ describe('determineMigrationAction', () => { test('requires no action if mappings differ only by equivalent coerced properties', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - hello: { dynamic: 'false', baz: '2', foo: 'bar' }, - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + hello: { dynamic: 'false', baz: '2', foo: 'bar' }, + world: { baz: 'bing' }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - hello: { dynamic: false, baz: 2, foo: 'bar' }, - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + hello: { dynamic: false, baz: 2, foo: 'bar' }, + world: { baz: 'bing' }, }, }; @@ -97,20 +85,16 @@ describe('determineMigrationAction', () => { test('requires no action if a root property has been disabled', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - hello: { dynamic: true, foo: 'bar' }, - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + hello: { dynamic: true, foo: 'bar' }, + world: { baz: 'bing' }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - world: { baz: 'bing' }, - }, + dynamic: 'strict', + properties: { + world: { baz: 'bing' }, }, }; @@ -119,19 +103,15 @@ describe('determineMigrationAction', () => { test('requires migration if a sub-property differs', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - world: { type: 'text' }, - }, + dynamic: 'strict', + properties: { + world: { type: 'text' }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - world: { type: 'keword' }, - }, + dynamic: 'strict', + properties: { + world: { type: 'keword' }, }, }; @@ -140,19 +120,15 @@ describe('determineMigrationAction', () => { test('requires migration if a type changes', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - meaning: { type: 'text' }, - }, + dynamic: 'strict', + properties: { + meaning: { type: 'text' }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - meaning: 42, - }, + dynamic: 'strict', + properties: { + meaning: 42, }, }; @@ -161,19 +137,15 @@ describe('determineMigrationAction', () => { test('requires migration if doc dynamic value differs', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - world: { type: 'text' }, - }, + dynamic: 'strict', + properties: { + world: { type: 'text' }, }, }; const expected = { - doc: { - dynamic: 'true', - properties: { - world: { type: 'text' }, - }, + dynamic: 'true', + properties: { + world: { type: 'text' }, }, }; @@ -182,17 +154,13 @@ describe('determineMigrationAction', () => { test('requires patching if we added a root property', () => { const actual = { - doc: { - dynamic: 'strict', - properties: {}, - }, + dynamic: 'strict', + properties: {}, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - world: { type: 'keword' }, - }, + dynamic: 'strict', + properties: { + world: { type: 'keword' }, }, }; @@ -201,26 +169,22 @@ describe('determineMigrationAction', () => { test('requires patching if we added a sub-property', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - world: { - properties: { - a: 'a', - }, + dynamic: 'strict', + properties: { + world: { + properties: { + a: 'a', }, }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - world: { - properties: { - a: 'a', - b: 'b', - }, + dynamic: 'strict', + properties: { + world: { + properties: { + a: 'a', + b: 'b', }, }, }, @@ -231,26 +195,22 @@ describe('determineMigrationAction', () => { test('requires migration if a sub property has been removed', () => { const actual = { - doc: { - dynamic: 'strict', - properties: { - world: { - properties: { - a: 'a', - b: 'b', - }, + dynamic: 'strict', + properties: { + world: { + properties: { + a: 'a', + b: 'b', }, }, }, }; const expected = { - doc: { - dynamic: 'strict', - properties: { - world: { - properties: { - b: 'b', - }, + dynamic: 'strict', + properties: { + world: { + properties: { + b: 'b', }, }, }, diff --git a/src/server/saved_objects/migrations/core/determine_migration_action.ts b/src/server/saved_objects/migrations/core/determine_migration_action.ts index 72d3a4b652fef..e0ef213a7ff88 100644 --- a/src/server/saved_objects/migrations/core/determine_migration_action.ts +++ b/src/server/saved_objects/migrations/core/determine_migration_action.ts @@ -38,12 +38,12 @@ export function determineMigrationAction( actual: IndexMapping, expected: IndexMapping ): MigrationAction { - if (actual.doc.dynamic !== expected.doc.dynamic) { + if (actual.dynamic !== expected.dynamic) { return MigrationAction.Migrate; } - const actualProps = actual.doc.properties; - const expectedProps = expected.doc.properties; + const actualProps = actual.properties; + const expectedProps = expected.properties; // There's a special case for root-level properties: if a root property is in actual, // but not in expected, it is treated like a disabled plugin and requires no action. diff --git a/src/server/saved_objects/migrations/core/elastic_index.test.ts b/src/server/saved_objects/migrations/core/elastic_index.test.ts index abc10155d63ae..6045d3f870ac1 100644 --- a/src/server/saved_objects/migrations/core/elastic_index.test.ts +++ b/src/server/saved_objects/migrations/core/elastic_index.test.ts @@ -19,7 +19,6 @@ import _ from 'lodash'; import sinon from 'sinon'; -import { ROOT_TYPE } from '../../serialization'; import * as Index from './elastic_index'; describe('ElasticIndex', () => { @@ -37,7 +36,7 @@ describe('ElasticIndex', () => { aliases: {}, exists: false, indexName: '.kibana-test', - mappings: { doc: { dynamic: 'strict', properties: {} } }, + mappings: { dynamic: 'strict', properties: {} }, }); }); @@ -79,7 +78,7 @@ describe('ElasticIndex', () => { return { [index]: { aliases: { foo: index }, - mappings: { doc: { dynamic: 'strict', properties: { a: 'b' } } }, + mappings: { dynamic: 'strict', properties: { a: 'b' } }, }, }; }); @@ -87,7 +86,7 @@ describe('ElasticIndex', () => { const info = await Index.fetchInfo(callCluster, '.baz'); expect(info).toEqual({ aliases: { foo: '.baz' }, - mappings: { doc: { dynamic: 'strict', properties: { a: 'b' } } }, + mappings: { dynamic: 'strict', properties: { a: 'b' } }, exists: true, indexName: '.baz', }); @@ -127,7 +126,6 @@ describe('ElasticIndex', () => { const callCluster = sinon.spy(async (path: string, { body, type, index }: any) => { expect(path).toEqual('indices.putMapping'); expect(index).toEqual('.shazm'); - expect(type).toEqual(ROOT_TYPE); expect(body).toEqual({ dynamic: 'strict', properties: { @@ -137,11 +135,9 @@ describe('ElasticIndex', () => { }); await Index.putMappings(callCluster, '.shazm', { - doc: { - dynamic: 'strict', - properties: { - foo: 'bar', - }, + dynamic: 'strict', + properties: { + foo: 'bar', }, }); @@ -246,10 +242,8 @@ describe('ElasticIndex', () => { case 'indices.create': expect(arg.body).toEqual({ mappings: { - doc: { - dynamic: 'strict', - properties: { foo: 'bar' }, - }, + dynamic: 'strict', + properties: { foo: 'bar' }, }, settings: { auto_expand_replicas: '0-1', number_of_shards: 1 }, }); @@ -292,10 +286,8 @@ describe('ElasticIndex', () => { exists: true, indexName: '.ze-index', mappings: { - doc: { - dynamic: 'strict', - properties: { foo: 'bar' }, - }, + dynamic: 'strict', + properties: { foo: 'bar' }, }, }; await Index.convertToAlias(callCluster, info, '.muchacha', 10); @@ -316,10 +308,8 @@ describe('ElasticIndex', () => { case 'indices.create': expect(arg.body).toEqual({ mappings: { - doc: { - dynamic: 'strict', - properties: { foo: 'bar' }, - }, + dynamic: 'strict', + properties: { foo: 'bar' }, }, settings: { auto_expand_replicas: '0-1', number_of_shards: 1 }, }); @@ -355,10 +345,8 @@ describe('ElasticIndex', () => { exists: true, indexName: '.ze-index', mappings: { - doc: { - dynamic: 'strict', - properties: { foo: 'bar' }, - }, + dynamic: 'strict', + properties: { foo: 'bar' }, }, }; await expect(Index.convertToAlias(callCluster, info, '.muchacha', 10)).rejects.toThrow( @@ -630,10 +618,8 @@ describe('ElasticIndex', () => { const { hasMigrations, callCluster } = await testMigrationsUpToDate({ index: '.myalias', mappings: { - doc: { - properties: { - dashboard: { type: 'text' }, - }, + properties: { + dashboard: { type: 'text' }, }, }, count: 0, @@ -647,7 +633,6 @@ describe('ElasticIndex', () => { { ignore: [404], index: '.myalias', - include_type_name: true, }, ], ]); @@ -657,14 +642,12 @@ describe('ElasticIndex', () => { const { hasMigrations, callCluster } = await testMigrationsUpToDate({ index: '.myalias', mappings: { - doc: { - properties: { - migrationVersion: { - dynamic: 'true', - type: 'object', - }, - dashboard: { type: 'text' }, + properties: { + migrationVersion: { + dynamic: 'true', + type: 'object', }, + dashboard: { type: 'text' }, }, }, count: 2, @@ -680,14 +663,12 @@ describe('ElasticIndex', () => { const { hasMigrations, callCluster } = await testMigrationsUpToDate({ index: '.myalias', mappings: { - doc: { - properties: { - migrationVersion: { - dynamic: 'true', - type: 'object', - }, - dashboard: { type: 'text' }, + properties: { + migrationVersion: { + dynamic: 'true', + type: 'object', }, + dashboard: { type: 'text' }, }, }, count: 0, @@ -704,14 +685,12 @@ describe('ElasticIndex', () => { const { hasMigrations, callCluster } = await testMigrationsUpToDate({ index: '.myalias', mappings: { - doc: { - properties: { - migrationVersion: { - dynamic: 'true', - type: 'object', - }, - dashboard: { type: 'text' }, + properties: { + migrationVersion: { + dynamic: 'true', + type: 'object', }, + dashboard: { type: 'text' }, }, }, count: 3, @@ -728,14 +707,12 @@ describe('ElasticIndex', () => { const { callCluster } = await testMigrationsUpToDate({ index: '.myalias', mappings: { - doc: { - properties: { - migrationVersion: { - dynamic: 'true', - type: 'object', - }, - dashboard: { type: 'text' }, + properties: { + migrationVersion: { + dynamic: 'true', + type: 'object', }, + dashboard: { type: 'text' }, }, }, count: 0, @@ -776,7 +753,6 @@ describe('ElasticIndex', () => { }, }, index: '.myalias', - type: ROOT_TYPE, }, ]); }); diff --git a/src/server/saved_objects/migrations/core/elastic_index.ts b/src/server/saved_objects/migrations/core/elastic_index.ts index ba6dafec3e5d9..a71050ddb5cf1 100644 --- a/src/server/saved_objects/migrations/core/elastic_index.ts +++ b/src/server/saved_objects/migrations/core/elastic_index.ts @@ -23,7 +23,7 @@ */ import _ from 'lodash'; -import { MigrationVersion, ROOT_TYPE } from '../../serialization'; +import { MigrationVersion } from '../../serialization'; import { AliasAction, CallCluster, @@ -33,10 +33,8 @@ import { ShardsInfo, } from './call_cluster'; -// Require rather than import gets us around the lack of TypeScript definitions -// for "getTypes" -// tslint:disable-next-line:no-var-requires -const { getTypes } = require('../../../mappings'); +// @ts-ignore untyped dependency +import { getTypes } from '../../../mappings'; const settings = { number_of_shards: 1, auto_expand_replicas: '0-1' }; @@ -55,7 +53,6 @@ export async function fetchInfo(callCluster: CallCluster, index: string): Promis const result = await callCluster('indices.get', { ignore: [404], index, - include_type_name: true, }); if ((result as NotFound).status === 404) { @@ -63,7 +60,7 @@ export async function fetchInfo(callCluster: CallCluster, index: string): Promis aliases: {}, exists: false, indexName: index, - mappings: { doc: { dynamic: 'strict', properties: {} } }, + mappings: { dynamic: 'strict', properties: {} }, }; } @@ -128,7 +125,6 @@ export async function write(callCluster: CallCluster, index: string, docs: RawDo index: { _id: doc._id, _index: index, - _type: ROOT_TYPE, }, }); @@ -171,7 +167,7 @@ export async function migrationsUpToDate( try { const indexInfo = await fetchInfo(callCluster, index); - if (!_.get(indexInfo, 'mappings.doc.properties.migrationVersion')) { + if (!_.get(indexInfo, 'mappings.properties.migrationVersion')) { return false; } @@ -196,7 +192,6 @@ export async function migrationsUpToDate( }, }, index, - type: ROOT_TYPE, }); assertResponseIncludeAllShards(response); @@ -223,11 +218,15 @@ export async function migrationsUpToDate( */ export function putMappings(callCluster: CallCluster, index: string, mappings: IndexMapping) { return callCluster('indices.putMapping', { - body: mappings.doc, index, - type: ROOT_TYPE, + + // HACK: This is a temporary workaround for a disconnect between + // elasticsearchjs and Elasticsearch 7.0. The JS library requires + // type, but Elasticsearch 7.0 has deprecated type... include_type_name: true, - }); + type: '_doc', + body: mappings, + } as any); } export async function createIndex( @@ -238,7 +237,6 @@ export async function createIndex( await callCluster('indices.create', { body: { mappings, settings }, index, - include_type_name: true, }); } @@ -310,14 +308,16 @@ export async function claimAlias( * @param {FullIndexInfo} indexInfo */ function assertIsSupportedIndex(indexInfo: FullIndexInfo) { - const currentTypes = getTypes(indexInfo.mappings); - const isV5Index = currentTypes.length > 1 || currentTypes[0] !== ROOT_TYPE; - if (isV5Index) { + const mappings = indexInfo.mappings as any; + const isV7Index = !!mappings.properties; + + if (!isV7Index) { throw new Error( `Index ${indexInfo.indexName} belongs to a version of Kibana ` + `that cannot be automatically migrated. Reset it or use the X-Pack upgrade assistant.` ); } + return indexInfo; } diff --git a/src/server/saved_objects/migrations/core/index_migrator.test.ts b/src/server/saved_objects/migrations/core/index_migrator.test.ts index ae8af7fa2db0f..a5be8e5216773 100644 --- a/src/server/saved_objects/migrations/core/index_migrator.test.ts +++ b/src/server/saved_objects/migrations/core/index_migrator.test.ts @@ -20,7 +20,7 @@ import _ from 'lodash'; import sinon from 'sinon'; import { SavedObjectsSchema } from '../../schema'; -import { ROOT_TYPE, SavedObjectDoc, SavedObjectsSerializer } from '../../serialization'; +import { SavedObjectDoc, SavedObjectsSerializer } from '../../serialization'; import { CallCluster } from './call_cluster'; import { IndexMigrator } from './index_migrator'; @@ -52,9 +52,9 @@ describe('IndexMigrator', () => { updated_at: { type: 'date' }, }, }, - index: '.kibana_1', include_type_name: true, - type: ROOT_TYPE, + type: '_doc', + index: '.kibana_1', }); }); @@ -72,25 +72,22 @@ describe('IndexMigrator', () => { sinon.assert.calledWith(callCluster, 'indices.create', { body: { mappings: { - doc: { - dynamic: 'strict', - properties: { - config: { - dynamic: 'true', - properties: { buildNum: { type: 'keyword' } }, - }, - foo: { type: 'long' }, - migrationVersion: { dynamic: 'true', type: 'object' }, - namespace: { type: 'keyword' }, - type: { type: 'keyword' }, - updated_at: { type: 'date' }, + dynamic: 'strict', + properties: { + config: { + dynamic: 'true', + properties: { buildNum: { type: 'keyword' } }, }, + foo: { type: 'long' }, + migrationVersion: { dynamic: 'true', type: 'object' }, + namespace: { type: 'keyword' }, + type: { type: 'keyword' }, + updated_at: { type: 'date' }, }, }, settings: { number_of_shards: 1, auto_expand_replicas: '0-1' }, }, index: '.kibana_1', - include_type_name: true, }); }); @@ -169,15 +166,12 @@ describe('IndexMigrator', () => { '.kibana_1': { aliases: {}, mappings: { - doc: { - properties: { - author: { type: 'text' }, - }, + properties: { + author: { type: 'text' }, }, }, }, }, - include_type_name: true, }); await new IndexMigrator(opts).migrate(); @@ -185,26 +179,23 @@ describe('IndexMigrator', () => { sinon.assert.calledWith(callCluster, 'indices.create', { body: { mappings: { - doc: { - dynamic: 'strict', - properties: { - author: { type: 'text' }, - config: { - dynamic: 'true', - properties: { buildNum: { type: 'keyword' } }, - }, - foo: { type: 'text' }, - migrationVersion: { dynamic: 'true', type: 'object' }, - namespace: { type: 'keyword' }, - type: { type: 'keyword' }, - updated_at: { type: 'date' }, + dynamic: 'strict', + properties: { + author: { type: 'text' }, + config: { + dynamic: 'true', + properties: { buildNum: { type: 'keyword' } }, }, + foo: { type: 'text' }, + migrationVersion: { dynamic: 'true', type: 'object' }, + namespace: { type: 'keyword' }, + type: { type: 'keyword' }, + updated_at: { type: 'date' }, }, }, settings: { number_of_shards: 1, auto_expand_replicas: '0-1' }, }, index: '.kibana_2', - include_type_name: true, }); }); @@ -285,13 +276,13 @@ describe('IndexMigrator', () => { expect(callCluster.args.filter(([action]) => action === 'bulk').length).toEqual(2); sinon.assert.calledWith(callCluster, 'bulk', { body: [ - { index: { _id: 'foo:1', _index: '.kibana_2', _type: ROOT_TYPE } }, + { index: { _id: 'foo:1', _index: '.kibana_2' } }, { foo: { name: 1 }, type: 'foo', migrationVersion: {} }, ], }); sinon.assert.calledWith(callCluster, 'bulk', { body: [ - { index: { _id: 'foo:2', _index: '.kibana_2', _type: ROOT_TYPE } }, + { index: { _id: 'foo:2', _index: '.kibana_2' } }, { foo: { name: 2 }, type: 'foo', migrationVersion: {} }, ], }); @@ -320,11 +311,9 @@ function withIndex(callCluster: sinon.SinonStub, opts: any = {}) { '.kibana_1': { aliases: { '.kibana': {} }, mappings: { - doc: { - dynamic: 'strict', - properties: { - migrationVersion: { dynamic: 'true', type: 'object' }, - }, + dynamic: 'strict', + properties: { + migrationVersion: { dynamic: 'true', type: 'object' }, }, }, }, diff --git a/src/server/saved_objects/migrations/core/migrate_raw_docs.test.ts b/src/server/saved_objects/migrations/core/migrate_raw_docs.test.ts index a4906b9c7ec85..01bd409da8b69 100644 --- a/src/server/saved_objects/migrations/core/migrate_raw_docs.test.ts +++ b/src/server/saved_objects/migrations/core/migrate_raw_docs.test.ts @@ -20,7 +20,7 @@ import _ from 'lodash'; import sinon from 'sinon'; import { SavedObjectsSchema } from '../../schema'; -import { ROOT_TYPE, SavedObjectsSerializer } from '../../serialization'; +import { SavedObjectsSerializer } from '../../serialization'; import { migrateRawDocs } from './migrate_raw_docs'; describe('migrateRawDocs', () => { @@ -35,12 +35,10 @@ describe('migrateRawDocs', () => { { _id: 'a:b', _source: { type: 'a', a: { name: 'HOI!' }, migrationVersion: {} }, - _type: ROOT_TYPE, }, { _id: 'c:d', _source: { type: 'c', c: { name: 'HOI!' }, migrationVersion: {} }, - _type: ROOT_TYPE, }, ]); @@ -59,7 +57,6 @@ describe('migrateRawDocs', () => { { _id: 'c:d', _source: { type: 'c', c: { name: 'TADA' }, migrationVersion: {} }, - _type: ROOT_TYPE, }, ]); diff --git a/src/server/saved_objects/migrations/core/migration_context.ts b/src/server/saved_objects/migrations/core/migration_context.ts index e660a53ef8fcf..eec4523919ae3 100644 --- a/src/server/saved_objects/migrations/core/migration_context.ts +++ b/src/server/saved_objects/migrations/core/migration_context.ts @@ -104,12 +104,10 @@ function createDestContext( exists: false, indexName: nextIndexName(source.indexName, alias), mappings: { - doc: { - ...activeMappings.doc, - properties: { - ...source.mappings.doc.properties, - ...activeMappings.doc.properties, - }, + ...activeMappings, + properties: { + ...source.mappings.properties, + ...activeMappings.properties, }, }, }; diff --git a/src/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap b/src/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap index 1ba3950e64920..1733f94ded552 100644 --- a/src/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap +++ b/src/server/saved_objects/migrations/kibana/__snapshots__/kibana_migrator.test.ts.snap @@ -2,36 +2,34 @@ exports[`KibanaMigrator getActiveMappings returns full index mappings w/ core properties 1`] = ` Object { - "doc": Object { - "dynamic": "strict", - "properties": Object { - "amap": Object { - "type": "text", - }, - "bmap": Object { - "type": "text", - }, - "config": Object { - "dynamic": "true", - "properties": Object { - "buildNum": Object { - "type": "keyword", - }, + "dynamic": "strict", + "properties": Object { + "amap": Object { + "type": "text", + }, + "bmap": Object { + "type": "text", + }, + "config": Object { + "dynamic": "true", + "properties": Object { + "buildNum": Object { + "type": "keyword", }, }, - "migrationVersion": Object { - "dynamic": "true", - "type": "object", - }, - "namespace": Object { - "type": "keyword", - }, - "type": Object { - "type": "keyword", - }, - "updated_at": Object { - "type": "date", - }, + }, + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "namespace": Object { + "type": "keyword", + }, + "type": Object { + "type": "keyword", + }, + "updated_at": Object { + "type": "date", }, }, } diff --git a/src/server/saved_objects/routes/find.js b/src/server/saved_objects/routes/find.js index c5890120e1441..27a30f0aa6427 100644 --- a/src/server/saved_objects/routes/find.js +++ b/src/server/saved_objects/routes/find.js @@ -31,6 +31,7 @@ export const createFindRoute = (prereqs) => ({ page: Joi.number().min(0).default(1), type: Joi.array().items(Joi.string()).single().required(), search: Joi.string().allow('').optional(), + default_search_operator: Joi.string().valid('OR', 'AND').default('OR'), search_fields: Joi.array().items(Joi.string()).single(), sort_field: Joi.array().items(Joi.string()).single(), fields: Joi.array().items(Joi.string()).single() diff --git a/src/server/saved_objects/routes/find.test.js b/src/server/saved_objects/routes/find.test.js index 3b1de7490367e..5c865c22f426b 100644 --- a/src/server/saved_objects/routes/find.test.js +++ b/src/server/saved_objects/routes/find.test.js @@ -105,7 +105,7 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 20, page: 1, type: ['foo', 'bar'] }); + expect(options).toEqual({ perPage: 20, page: 1, type: ['foo', 'bar'], defaultSearchOperator: 'OR' }); }); it('accepts the query parameter page/per_page', async () => { @@ -119,7 +119,7 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 10, page: 50, type: ['foo'] }); + expect(options).toEqual({ perPage: 10, page: 50, type: ['foo'], defaultSearchOperator: 'OR' }); }); it('accepts the query parameter search_fields', async () => { @@ -133,7 +133,7 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 20, page: 1, searchFields: ['title'], type: ['foo'] }); + expect(options).toEqual({ perPage: 20, page: 1, searchFields: ['title'], type: ['foo'], defaultSearchOperator: 'OR' }); }); it('accepts the query parameter fields as a string', async () => { @@ -147,7 +147,7 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 20, page: 1, fields: ['title'], type: ['foo'] }); + expect(options).toEqual({ perPage: 20, page: 1, fields: ['title'], type: ['foo'], defaultSearchOperator: 'OR' }); }); it('accepts the query parameter fields as an array', async () => { @@ -162,7 +162,7 @@ describe('GET /api/saved_objects/_find', () => { const options = savedObjectsClient.find.getCall(0).args[0]; expect(options).toEqual({ - perPage: 20, page: 1, fields: ['title', 'description'], type: ['foo'] + perPage: 20, page: 1, fields: ['title', 'description'], type: ['foo'], defaultSearchOperator: 'OR' }); }); @@ -177,7 +177,7 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 20, page: 1, type: ['index-pattern'] }); + expect(options).toEqual({ perPage: 20, page: 1, type: ['index-pattern'], defaultSearchOperator: 'OR' }); }); it('accepts the query parameter type as an array', async () => { @@ -191,6 +191,6 @@ describe('GET /api/saved_objects/_find', () => { expect(savedObjectsClient.find.calledOnce).toBe(true); const options = savedObjectsClient.find.getCall(0).args[0]; - expect(options).toEqual({ perPage: 20, page: 1, type: ['index-pattern', 'visualization'] }); + expect(options).toEqual({ perPage: 20, page: 1, type: ['index-pattern', 'visualization'], defaultSearchOperator: 'OR' }); }); }); diff --git a/src/server/saved_objects/serialization/index.ts b/src/server/saved_objects/serialization/index.ts index 46b869cb28a85..09b8ddd94325a 100644 --- a/src/server/saved_objects/serialization/index.ts +++ b/src/server/saved_objects/serialization/index.ts @@ -25,11 +25,6 @@ import uuid from 'uuid'; import { SavedObjectsSchema } from '../schema'; -/** - * The root document type. In 7.0, this needs to change to '_doc'. - */ -export const ROOT_TYPE = 'doc'; - /** * A raw document as represented directly in the saved object index. */ @@ -130,7 +125,6 @@ export class SavedObjectsSerializer { return { _id: this.generateRawId(namespace, type, id), _source: source, - _type: ROOT_TYPE, ...(version != null && { _version: version }), }; } diff --git a/src/server/saved_objects/serialization/serialization.test.ts b/src/server/saved_objects/serialization/serialization.test.ts index 686acf8521e36..43ff4a2df7252 100644 --- a/src/server/saved_objects/serialization/serialization.test.ts +++ b/src/server/saved_objects/serialization/serialization.test.ts @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { ROOT_TYPE, SavedObjectsSerializer } from '.'; +import { SavedObjectsSerializer } from '.'; import { SavedObjectsSchema } from '../schema'; describe('saved object conversion', () => { @@ -68,7 +68,6 @@ describe('saved object conversion', () => { const serializer = new SavedObjectsSerializer(new SavedObjectsSchema()); const actual = serializer.rawToSavedObject({ _id: 'hello:world', - _type: ROOT_TYPE, _version: 3, _source: { type: 'hello', @@ -153,7 +152,6 @@ describe('saved object conversion', () => { const serializer = new SavedObjectsSerializer(new SavedObjectsSchema()); const actual = serializer.rawToSavedObject({ _id: 'universe', - _type: ROOT_TYPE, _source: { type: 'hello', hello: { @@ -175,7 +173,6 @@ describe('saved object conversion', () => { const serializer = new SavedObjectsSerializer(new SavedObjectsSchema()); const actual = serializer.rawToSavedObject({ _id: 'universe', - _type: ROOT_TYPE, _source: { type: 'hello', }, @@ -191,7 +188,6 @@ describe('saved object conversion', () => { expect(() => serializer.rawToSavedObject({ _id: 'universe', - _type: ROOT_TYPE, _source: { hello: { world: 'earth', @@ -205,7 +201,6 @@ describe('saved object conversion', () => { const serializer = new SavedObjectsSerializer(new SavedObjectsSchema()); const raw = { _id: 'foo-namespace:foo:bar', - _type: ROOT_TYPE, _version: 24, _source: { type: 'foo', @@ -387,7 +382,6 @@ describe('saved object conversion', () => { attributes: {}, } as any); - expect(actual).toHaveProperty('_type', ROOT_TYPE); expect(actual._source).toHaveProperty('type', 'foo'); }); diff --git a/src/server/saved_objects/service/create_saved_objects_service.d.ts b/src/server/saved_objects/service/create_saved_objects_service.d.ts index 6fa27ca4d7d81..086ac02dad75b 100644 --- a/src/server/saved_objects/service/create_saved_objects_service.d.ts +++ b/src/server/saved_objects/service/create_saved_objects_service.d.ts @@ -17,19 +17,16 @@ * under the License. */ -import { SavedObjectsRepository, ScopedSavedObjectsClientProvider } from './lib'; +import { ScopedSavedObjectsClientProvider } from './lib'; import { SavedObjectsClient } from './saved_objects_client'; export interface SavedObjectsService { // ATTENTION: these types are incomplete - addScopedSavedObjectsClientWrapperFactory: ScopedSavedObjectsClientProvider< Request >['addClientWrapperFactory']; - getSavedObjectsRepository: ( - callCluster: (endpoint: string, clientParams: any, options: any) => Promise - ) => SavedObjectsRepository; getScopedSavedObjectsClient: ScopedSavedObjectsClientProvider['getClient']; SavedObjectsClient: typeof SavedObjectsClient; types: string[]; + getSavedObjectsRepository(...rest: any[]): any; } diff --git a/src/server/saved_objects/service/create_saved_objects_service.js b/src/server/saved_objects/service/create_saved_objects_service.js index 8b56daa1a3398..594ebbccfadb5 100644 --- a/src/server/saved_objects/service/create_saved_objects_service.js +++ b/src/server/saved_objects/service/create_saved_objects_service.js @@ -31,46 +31,6 @@ import { SavedObjectsClient } from './saved_objects_client'; // Eventually, we hope to build a first-class import / export API, at which point, we can // remove the migrator from the saved objects client and leave only document validation here. export function createSavedObjectsService(server, schema, serializer, migrator) { - const onBeforeWrite = async () => { - const adminCluster = server.plugins.elasticsearch.getCluster('admin'); - - try { - const index = server.config().get('kibana.index'); - await adminCluster.callWithInternalUser('indices.putTemplate', { - name: `kibana_index_template:${index}`, - include_type_name: true, - body: { - template: index, - settings: { - number_of_shards: 1, - auto_expand_replicas: '0-1', - }, - mappings: server.getKibanaIndexMappingsDsl(), - }, - }); - } catch (error) { - server.logWithMetadata( - ['debug', 'savedObjects'], - `Attempt to write indexTemplate for SavedObjects index failed: ${error.message}`, - { - es: { - resp: error.body, - status: error.status, - }, - err: { - message: error.message, - stack: error.stack, - }, - } - ); - - // We reject with `es.ServiceUnavailable` because writing an index - // template is a very simple operation so if we get an error here - // then something must be very broken - throw new adminCluster.errors.ServiceUnavailable(); - } - }; - const mappings = server.getKibanaIndexMappingsDsl(); const repositoryProvider = new SavedObjectsRepositoryProvider({ index: server.config().get('kibana.index'), @@ -78,13 +38,11 @@ export function createSavedObjectsService(server, schema, serializer, migrator) mappings, schema, serializer, - onBeforeWrite, }); const scopedClientProvider = new ScopedSavedObjectsClientProvider({ index: server.config().get('kibana.index'), mappings, - onBeforeWrite, defaultClientFactory({ request, }) { diff --git a/src/server/saved_objects/service/lib/repository.js b/src/server/saved_objects/service/lib/repository.js index 2f28081e96606..c047b6d72edc1 100644 --- a/src/server/saved_objects/service/lib/repository.js +++ b/src/server/saved_objects/service/lib/repository.js @@ -18,7 +18,7 @@ */ import { omit } from 'lodash'; -import { getRootType, getRootPropertiesObjects } from '../../../mappings'; +import { getRootPropertiesObjects } from '../../../mappings'; import { getSearchDsl } from './search_dsl'; import { includedFields } from './included_fields'; import { decorateEsError } from './decorate_es_error'; @@ -50,7 +50,9 @@ export class SavedObjectsRepository { this._index = index; this._mappings = mappings; this._schema = schema; - this._type = getRootType(this._mappings); + + // ES7 and up expects the root type to be _doc + this._type = '_doc'; this._onBeforeWrite = onBeforeWrite; this._unwrappedCallCluster = async (...args) => { await migrator.awaitMigration(); @@ -281,6 +283,7 @@ export class SavedObjectsRepository { * @param {object} [options={}] * @property {(string|Array)} [options.type] * @property {string} [options.search] + * @property {string} [options.defaultSearchOperator] * @property {Array} [options.searchFields] - see Elasticsearch Simple Query String * Query field argument for more information * @property {integer} [options.page=1] @@ -295,6 +298,7 @@ export class SavedObjectsRepository { const { type, search, + defaultSearchOperator = 'OR', searchFields, page = 1, perPage = 20, @@ -313,7 +317,7 @@ export class SavedObjectsRepository { } if (fields && !Array.isArray(fields)) { - throw new TypeError('options.searchFields must be an array'); + throw new TypeError('options.fields must be an array'); } const esOptions = { @@ -327,6 +331,7 @@ export class SavedObjectsRepository { version: true, ...getSearchDsl(this._mappings, this._schema, { search, + defaultSearchOperator, searchFields, type, sortField, diff --git a/src/server/saved_objects/service/lib/repository.test.js b/src/server/saved_objects/service/lib/repository.test.js index 3771cdee44f7a..2862785694211 100644 --- a/src/server/saved_objects/service/lib/repository.test.js +++ b/src/server/saved_objects/service/lib/repository.test.js @@ -44,7 +44,7 @@ describe('SavedObjectsRepository', () => { total: 4, hits: [{ _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'index-pattern:logstash-*', _score: 1, _source: { @@ -58,7 +58,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'config:6.0.0-alpha1', _score: 1, _source: { @@ -71,7 +71,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'index-pattern:stocks-*', _score: 1, _source: { @@ -85,7 +85,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'globaltype:something', _score: 1, _source: { @@ -104,7 +104,7 @@ describe('SavedObjectsRepository', () => { total: 4, hits: [{ _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'foo-namespace:index-pattern:logstash-*', _score: 1, _source: { @@ -119,7 +119,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'foo-namespace:config:6.0.0-alpha1', _score: 1, _source: { @@ -133,7 +133,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'foo-namespace:index-pattern:stocks-*', _score: 1, _source: { @@ -148,7 +148,7 @@ describe('SavedObjectsRepository', () => { } }, { _index: '.kibana', - _type: 'doc', + _type: '_doc', _id: 'globaltype:something', _score: 1, _source: { @@ -178,27 +178,25 @@ describe('SavedObjectsRepository', () => { }; const mappings = { - doc: { - properties: { - 'index-pattern': { - properties: { - someField: { - type: 'keyword' - } + properties: { + 'index-pattern': { + properties: { + someField: { + type: 'keyword' } - }, - 'dashboard': { - properties: { - otherField: { - type: 'keyword' - } + } + }, + 'dashboard': { + properties: { + otherField: { + type: 'keyword' } - }, - 'globaltype': { - properties: { - yetAnotherField: { - type: 'keyword' - } + } + }, + 'globaltype': { + properties: { + yetAnotherField: { + type: 'keyword' } } } @@ -237,7 +235,7 @@ describe('SavedObjectsRepository', () => { describe('#create', () => { beforeEach(() => { callAdminCluster.callsFake((method, params) => ({ - _type: 'doc', + _type: '_doc', _id: params.id, _version: 2 })); @@ -440,9 +438,9 @@ describe('SavedObjectsRepository', () => { expect(bulkCalls.length).toEqual(1); expect(bulkCalls[0][1].body).toEqual([ - { create: { _type: 'doc', _id: 'config:one' } }, + { create: { _type: '_doc', _id: 'config:one' } }, { type: 'config', ...mockTimestampFields, config: { title: 'Test One' } }, - { create: { _type: 'doc', _id: 'index-pattern:two' } }, + { create: { _type: '_doc', _id: 'index-pattern:two' } }, { type: 'index-pattern', ...mockTimestampFields, 'index-pattern': { title: 'Test Two' } } ]); @@ -464,9 +462,9 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ - { create: { _type: 'doc', _id: 'config:one' } }, + { create: { _type: '_doc', _id: 'config:one' } }, { type: 'config', ...mockTimestampFields, config: { title: 'Test One!!' }, migrationVersion: { foo: '2.3.4' } }, - { create: { _type: 'doc', _id: 'index-pattern:two' } }, + { create: { _type: '_doc', _id: 'index-pattern:two' } }, { type: 'index-pattern', ...mockTimestampFields, 'index-pattern': { title: 'Test Two!!' }, migrationVersion: { foo: '2.3.4' } } ] })); @@ -480,7 +478,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ // uses create because overwriting is not allowed - { create: { _type: 'doc', _id: 'foo:bar' } }, + { create: { _type: '_doc', _id: 'foo:bar' } }, { type: 'foo', ...mockTimestampFields, 'foo': {} }, ] })); @@ -495,7 +493,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ // uses index because overwriting is allowed - { index: { _type: 'doc', _id: 'foo:bar' } }, + { index: { _type: '_doc', _id: 'foo:bar' } }, { type: 'foo', ...mockTimestampFields, 'foo': {} }, ] })); @@ -508,7 +506,7 @@ describe('SavedObjectsRepository', () => { errors: false, items: [{ create: { - _type: 'doc', + _type: '_doc', _id: 'config:one', error: { reason: 'type[config] missing' @@ -516,7 +514,7 @@ describe('SavedObjectsRepository', () => { } }, { create: { - _type: 'doc', + _type: '_doc', _id: 'index-pattern:two', _version: 2 } @@ -550,13 +548,13 @@ describe('SavedObjectsRepository', () => { errors: false, items: [{ create: { - _type: 'doc', + _type: '_doc', _id: 'config:one', _version: 2 } }, { create: { - _type: 'doc', + _type: '_doc', _id: 'index-pattern:two', _version: 2 } @@ -603,9 +601,9 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ - { create: { _type: 'doc', _id: 'foo-namespace:config:one' } }, + { create: { _type: '_doc', _id: 'foo-namespace:config:one' } }, { namespace: 'foo-namespace', type: 'config', ...mockTimestampFields, config: { title: 'Test One' } }, - { create: { _type: 'doc', _id: 'foo-namespace:index-pattern:two' } }, + { create: { _type: '_doc', _id: 'foo-namespace:index-pattern:two' } }, { namespace: 'foo-namespace', type: 'index-pattern', ...mockTimestampFields, 'index-pattern': { title: 'Test Two' } } ] })); @@ -621,9 +619,9 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ - { create: { _type: 'doc', _id: 'config:one' } }, + { create: { _type: '_doc', _id: 'config:one' } }, { type: 'config', ...mockTimestampFields, config: { title: 'Test One' } }, - { create: { _type: 'doc', _id: 'index-pattern:two' } }, + { create: { _type: '_doc', _id: 'index-pattern:two' } }, { type: 'index-pattern', ...mockTimestampFields, 'index-pattern': { title: 'Test Two' } } ] })); @@ -643,7 +641,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'bulk', sinon.match({ body: [ - { create: { _type: 'doc', _id: 'globaltype:one' } }, + { create: { _type: '_doc', _id: 'globaltype:one' } }, { type: 'globaltype', ...mockTimestampFields, 'globaltype': { title: 'Test One' } }, ] })); @@ -688,7 +686,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'delete', { - type: 'doc', + type: '_doc', id: 'foo-namespace:index-pattern:logstash-*', refresh: 'wait_for', index: '.kibana-test', @@ -706,7 +704,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'delete', { - type: 'doc', + type: '_doc', id: 'index-pattern:logstash-*', refresh: 'wait_for', index: '.kibana-test', @@ -726,7 +724,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'delete', { - type: 'doc', + type: '_doc', id: 'globaltype:logstash-*', refresh: 'wait_for', index: '.kibana-test', @@ -814,7 +812,7 @@ describe('SavedObjectsRepository', () => { } }); - it('passes mappings, schema, search, searchFields, type, sortField, and sortOrder to getSearchDsl', async () => { + it('passes mappings, schema, search, defaultSearchOperator, searchFields, type, sortField, and sortOrder to getSearchDsl', async () => { callAdminCluster.returns(namespacedSearchResults); const relevantOpts = { namespace: 'foo-namespace', @@ -823,6 +821,7 @@ describe('SavedObjectsRepository', () => { type: 'bar', sortField: 'name', sortOrder: 'desc', + defaultSearchOperator: 'AND', }; await savedObjectsRepository.find(relevantOpts); @@ -925,7 +924,7 @@ describe('SavedObjectsRepository', () => { describe('#get', () => { const noNamespaceResult = { _id: 'index-pattern:logstash-*', - _type: 'doc', + _type: '_doc', _version: 2, _source: { type: 'index-pattern', @@ -938,7 +937,7 @@ describe('SavedObjectsRepository', () => { }; const namespacedResult = { _id: 'foo-namespace:index-pattern:logstash-*', - _type: 'doc', + _type: '_doc', _version: 2, _source: { namespace: 'foo-namespace', @@ -1000,7 +999,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, sinon.match.string, sinon.match({ id: 'foo-namespace:index-pattern:logstash-*', - type: 'doc' + type: '_doc' })); }); @@ -1012,7 +1011,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, sinon.match.string, sinon.match({ id: 'index-pattern:logstash-*', - type: 'doc' + type: '_doc' })); }); @@ -1026,7 +1025,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, sinon.match.string, sinon.match({ id: 'globaltype:logstash-*', - type: 'doc' + type: '_doc' })); }); }); @@ -1058,9 +1057,9 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledWithExactly(callAdminCluster, sinon.match.string, sinon.match({ body: { docs: [ - { _type: 'doc', _id: 'config:one' }, - { _type: 'doc', _id: 'index-pattern:two' }, - { _type: 'doc', _id: 'globaltype:three' }, + { _type: '_doc', _id: 'config:one' }, + { _type: '_doc', _id: 'index-pattern:two' }, + { _type: '_doc', _id: 'globaltype:three' }, ] } })); @@ -1085,9 +1084,9 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledWithExactly(callAdminCluster, sinon.match.string, sinon.match({ body: { docs: [ - { _type: 'doc', _id: 'foo-namespace:config:one' }, - { _type: 'doc', _id: 'foo-namespace:index-pattern:two' }, - { _type: 'doc', _id: 'globaltype:three' }, + { _type: '_doc', _id: 'foo-namespace:config:one' }, + { _type: '_doc', _id: 'foo-namespace:index-pattern:two' }, + { _type: '_doc', _id: 'globaltype:three' }, ] } })); @@ -1108,13 +1107,13 @@ describe('SavedObjectsRepository', () => { it('reports error on missed objects', async () => { callAdminCluster.returns(Promise.resolve({ docs: [{ - _type: 'doc', + _type: '_doc', _id: 'config:good', found: true, _version: 2, _source: { ...mockTimestampFields, config: { title: 'Test' } } }, { - _type: 'doc', + _type: '_doc', _id: 'config:bad', found: false }] @@ -1152,7 +1151,7 @@ describe('SavedObjectsRepository', () => { beforeEach(() => { callAdminCluster.returns(Promise.resolve({ _id: `${type}:${id}`, - _type: 'doc', + _type: '_doc', _version: newVersion, result: 'updated' })); @@ -1202,7 +1201,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'update', { - type: 'doc', + type: '_doc', id: 'foo-namespace:index-pattern:logstash-*', version: undefined, body: { @@ -1221,7 +1220,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'update', { - type: 'doc', + type: '_doc', id: 'index-pattern:logstash-*', version: undefined, body: { @@ -1244,7 +1243,7 @@ describe('SavedObjectsRepository', () => { sinon.assert.calledOnce(callAdminCluster); sinon.assert.calledWithExactly(callAdminCluster, 'update', { - type: 'doc', + type: '_doc', id: 'globaltype:foo', version: undefined, body: { @@ -1262,7 +1261,7 @@ describe('SavedObjectsRepository', () => { describe('#incrementCounter', () => { beforeEach(() => { callAdminCluster.callsFake((method, params) => ({ - _type: 'doc', + _type: '_doc', _id: params.id, _version: 2, _index: '.kibana', @@ -1282,7 +1281,7 @@ describe('SavedObjectsRepository', () => { it('formats Elasticsearch response', async () => { callAdminCluster.callsFake((method, params) => ({ - _type: 'doc', + _type: '_doc', _id: params.id, _version: 2, _index: '.kibana', @@ -1382,7 +1381,7 @@ describe('SavedObjectsRepository', () => { it(`doesn't prepend namespace to the id or add namespace property when providing namespace for namespace agnostic type`, async () => { callAdminCluster.callsFake((method, params) => ({ - _type: 'doc', + _type: '_doc', _id: params.id, _version: 2, _index: '.kibana', diff --git a/src/server/saved_objects/service/lib/search_dsl/query_params.js b/src/server/saved_objects/service/lib/search_dsl/query_params.js index 5bcff743c1082..47e5812e5eb2e 100644 --- a/src/server/saved_objects/service/lib/search_dsl/query_params.js +++ b/src/server/saved_objects/service/lib/search_dsl/query_params.js @@ -98,9 +98,10 @@ function getClauseForType(schema, namespace, type) { * @param {(string|Array)} type * @param {String} search * @param {Array} searchFields + * @param {String} defaultSearchOperator * @return {Object} */ -export function getQueryParams(mappings, schema, namespace, type, search, searchFields) { +export function getQueryParams(mappings, schema, namespace, type, search, searchFields, defaultSearchOperator) { const types = getTypes(mappings, type); const bool = { filter: [{ @@ -119,7 +120,8 @@ export function getQueryParams(mappings, schema, namespace, type, search, search ...getFieldsForTypes( searchFields, types - ) + ), + ...(defaultSearchOperator ? { default_operator: defaultSearchOperator } : {}), } } ]; diff --git a/src/server/saved_objects/service/lib/search_dsl/query_params.test.js b/src/server/saved_objects/service/lib/search_dsl/query_params.test.js index 45f241ba41883..8e98fe3a023cb 100644 --- a/src/server/saved_objects/service/lib/search_dsl/query_params.test.js +++ b/src/server/saved_objects/service/lib/search_dsl/query_params.test.js @@ -20,42 +20,40 @@ import { getQueryParams } from './query_params'; const MAPPINGS = { - rootType: { - properties: { - type: { - type: 'keyword' - }, - pending: { - properties: { - title: { - type: 'text', - } + properties: { + type: { + type: 'keyword' + }, + pending: { + properties: { + title: { + type: 'text', } - }, - saved: { - properties: { - title: { - type: 'text', - fields: { - raw: { - type: 'keyword' - } + } + }, + saved: { + properties: { + title: { + type: 'text', + fields: { + raw: { + type: 'keyword' } - }, - obj: { - properties: { - key1: { - type: 'text' - } + } + }, + obj: { + properties: { + key1: { + type: 'text' } } } - }, - global: { - properties: { - name: { - type: 'keyword', - } + } + }, + global: { + properties: { + name: { + type: 'keyword', } } } @@ -716,4 +714,68 @@ describe('searchDsl/queryParams', () => { }); }); }); + + describe('type (plural, namespaced and global), search, defaultSearchOperator', () => { + it('supports defaultSearchOperator', () => { + expect(getQueryParams(MAPPINGS, SCHEMA, 'foo-namespace', ['saved', 'global'], 'foo', null, 'AND')) + .toEqual({ + query: { + bool: { + filter: [ + { + bool: { + minimum_should_match: 1, + should: [ + { + bool: { + must: [ + { + term: { + type: 'saved', + }, + }, + { + term: { + namespace: 'foo-namespace', + }, + }, + ], + }, + }, + { + bool: { + must: [ + { + term: { + type: 'global', + }, + }, + ], + must_not: [ + { + exists: { + field: 'namespace', + }, + }, + ], + }, + }, + ], + }, + }, + ], + must: [ + { + simple_query_string: { + all_fields: true, + default_operator: 'AND', + query: 'foo', + }, + }, + ], + }, + }, + }); + }); + }); }); diff --git a/src/server/saved_objects/service/lib/search_dsl/search_dsl.js b/src/server/saved_objects/service/lib/search_dsl/search_dsl.js index a0434aa2f9f8b..d6a224f4c3857 100644 --- a/src/server/saved_objects/service/lib/search_dsl/search_dsl.js +++ b/src/server/saved_objects/service/lib/search_dsl/search_dsl.js @@ -26,6 +26,7 @@ export function getSearchDsl(mappings, schema, options = {}) { const { type, search, + defaultSearchOperator, searchFields, sortField, sortOrder, @@ -41,7 +42,7 @@ export function getSearchDsl(mappings, schema, options = {}) { } return { - ...getQueryParams(mappings, schema, namespace, type, search, searchFields), + ...getQueryParams(mappings, schema, namespace, type, search, searchFields, defaultSearchOperator), ...getSortingParams(mappings, type, sortField, sortOrder), }; } diff --git a/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js b/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js index 18c1aa4e9a4fc..1ba780fc79ed0 100644 --- a/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js +++ b/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js @@ -55,6 +55,7 @@ describe('getSearchDsl', () => { type: 'foo', search: 'bar', searchFields: ['baz'], + defaultSearchOperator: 'AND', }; getSearchDsl(mappings, schema, opts); @@ -67,6 +68,7 @@ describe('getSearchDsl', () => { opts.type, opts.search, opts.searchFields, + opts.defaultSearchOperator, ); }); diff --git a/src/server/saved_objects/service/lib/search_dsl/sorting_params.test.js b/src/server/saved_objects/service/lib/search_dsl/sorting_params.test.js index 71833f1395659..7d4268469ffa5 100644 --- a/src/server/saved_objects/service/lib/search_dsl/sorting_params.test.js +++ b/src/server/saved_objects/service/lib/search_dsl/sorting_params.test.js @@ -20,43 +20,41 @@ import { getSortingParams } from './sorting_params'; const MAPPINGS = { - rootType: { - properties: { - type: { - type: 'text', - fields: { - raw: { - type: 'keyword' - } + properties: { + type: { + type: 'text', + fields: { + raw: { + type: 'keyword' } - }, - pending: { - properties: { - title: { - type: 'text', - fields: { - raw: { - type: 'keyword' - } + } + }, + pending: { + properties: { + title: { + type: 'text', + fields: { + raw: { + type: 'keyword' } } } - }, - saved: { - properties: { - title: { - type: 'text', - fields: { - raw: { - type: 'keyword' - } + } + }, + saved: { + properties: { + title: { + type: 'text', + fields: { + raw: { + type: 'keyword' } - }, - obj: { - properties: { - key1: { - type: 'text' - } + } + }, + obj: { + properties: { + key1: { + type: 'text' } } } diff --git a/src/server/saved_objects/service/saved_objects_client.d.ts b/src/server/saved_objects/service/saved_objects_client.d.ts index 3df4249a48a01..a6e10aa1b85b1 100644 --- a/src/server/saved_objects/service/saved_objects_client.d.ts +++ b/src/server/saved_objects/service/saved_objects_client.d.ts @@ -28,30 +28,32 @@ export interface CreateOptions extends BaseOptions { override?: boolean; } -export interface BulkCreateObject { +export interface BulkCreateObject { id?: string; type: string; - attributes: SavedObjectAttributes; + attributes: T; extraDocumentProperties?: string[]; } -export interface BulkCreateResponse { - savedObjects: SavedObject[]; +export interface BulkCreateResponse { + savedObjects: Array>; } export interface FindOptions extends BaseOptions { + type?: string | string[]; page?: number; perPage?: number; sortField?: string; sortOrder?: string; fields?: string[]; - type?: string | string[]; + search?: string; + searchFields?: string[]; } -export interface FindResponse { - saved_objects: SavedObject[]; +export interface FindResponse { + saved_objects: Array>; total: number; - perPage: number; + per_page: number; page: number; } @@ -65,15 +67,15 @@ export interface BulkGetObject { } export type BulkGetObjects = BulkGetObject[]; -export interface BulkGetResponse { - savedObjects: SavedObject[]; +export interface BulkGetResponse { + savedObjects: Array>; } export interface SavedObjectAttributes { [key: string]: SavedObjectAttributes | string | number | boolean | null; } -export interface SavedObject { +export interface SavedObject { id: string; type: string; version?: number; @@ -81,30 +83,41 @@ export interface SavedObject { error?: { message: string; }; - attributes: SavedObjectAttributes; + attributes: T; } export declare class SavedObjectsClient { public static errors: typeof errors; public errors: typeof errors; - public create: ( + + constructor(repository: SavedObjectsRepository); + + public create( type: string, - attributes: SavedObjectAttributes, + attributes: T, options?: CreateOptions - ) => Promise; - public bulkCreate: ( - objects: BulkCreateObject[], + ): Promise>; + public bulkCreate( + objects: Array>, options?: CreateOptions - ) => Promise; - public delete: (type: string, id: string, options?: BaseOptions) => Promise<{}>; - public find: (options: FindOptions) => Promise; - public bulkGet: (objects: BulkGetObjects, options?: BaseOptions) => Promise; - public get: (type: string, id: string, options?: BaseOptions) => Promise; - public update: ( + ): Promise>; + public delete(type: string, id: string, options?: BaseOptions): Promise<{}>; + public find( + options: FindOptions + ): Promise>; + public bulkGet( + objects: BulkGetObjects, + options?: BaseOptions + ): Promise>; + public get( + type: string, + id: string, + options?: BaseOptions + ): Promise>; + public update( type: string, id: string, - attributes: SavedObjectAttributes, + attributes: Partial, options?: UpdateOptions - ) => Promise; - constructor(repository: SavedObjectsRepository); + ): Promise>; } diff --git a/src/server/saved_objects/service/saved_objects_client.js b/src/server/saved_objects/service/saved_objects_client.js index f1dc4dfbbc190..a354067e6f702 100644 --- a/src/server/saved_objects/service/saved_objects_client.js +++ b/src/server/saved_objects/service/saved_objects_client.js @@ -139,6 +139,7 @@ export class SavedObjectsClient { * @param {object} [options={}] * @property {(string|Array)} [options.type] * @property {string} [options.search] + * @property {string} [options.defaultSearchOperator] * @property {Array} [options.searchFields] - see Elasticsearch Simple Query String * Query field argument for more information * @property {integer} [options.page=1] diff --git a/src/ui/public/courier/saved_object/saved_object_loader.js b/src/ui/public/courier/saved_object/saved_object_loader.js index c860fc0eaf336..511edd30ec549 100644 --- a/src/ui/public/courier/saved_object/saved_object_loader.js +++ b/src/ui/public/courier/saved_object/saved_object_loader.js @@ -118,6 +118,7 @@ export class SavedObjectLoader { perPage: size, page: 1, searchFields: ['title^3', 'description'], + defaultSearchOperator: 'AND', fields, }).then((resp) => { return { diff --git a/src/ui/public/courier/utils/courier_inspector_utils.js b/src/ui/public/courier/utils/courier_inspector_utils.js index 55b52ad3a4cac..0e53f92bd9dcb 100644 --- a/src/ui/public/courier/utils/courier_inspector_utils.js +++ b/src/ui/public/courier/utils/courier_inspector_utils.js @@ -23,53 +23,92 @@ * and the returned object can be passed to the `stats` method of the request * logger. */ + +import { i18n } from '@kbn/i18n'; + function getRequestInspectorStats(searchSource) { const stats = {}; const index = searchSource.getField('index'); if (index) { - stats['Index pattern'] = { + stats.indexPattern = { + label: i18n.translate('common.ui.courier.indexPatternLabel', { + defaultMessage: 'Index pattern' + }), value: index.title, - description: 'The index pattern that connected to the Elasticsearch indices.', + description: i18n.translate('common.ui.courier.indexPatternDescription', { + defaultMessage: 'The index pattern that connected to the Elasticsearch indices.' + }), }; - stats ['Index pattern ID'] = { + stats.indexPatternId = { + label: i18n.translate('common.ui.courier.indexPatternIdLabel', { + defaultMessage: 'Index pattern ID' + }), value: index.id, - description: 'The ID in the .kibana index.', + description: i18n.translate('common.ui.courier.indexPatternIdDescription', { + defaultMessage: 'The ID in the {kibanaIndexPattern} index.', + values: { kibanaIndexPattern: '.kibana' } + }), }; } return stats; } - function getResponseInspectorStats(searchSource, resp) { const lastRequest = searchSource.history && searchSource.history[searchSource.history.length - 1]; const stats = {}; if (resp && resp.took) { - stats['Query time'] = { - value: `${resp.took}ms`, - description: `The time it took to process the query. - Does not include the time to send the request or parse it in the browser.`, + stats.queryTime = { + label: i18n.translate('common.ui.courier.queryTimeLabel', { + defaultMessage: 'Query time' + }), + value: i18n.translate('common.ui.courier.queryTimeValue', { + defaultMessage: '{queryTime}ms', + values: { queryTime: resp.took }, + }), + description: i18n.translate('common.ui.courier.queryTimeDescription', { + defaultMessage: 'The time it took to process the query. ' + + 'Does not include the time to send the request or parse it in the browser.' + }), }; } if (resp && resp.hits) { - stats['Hits (total)'] = { + stats.hitsTotal = { + label: i18n.translate('common.ui.courier.hitsTotalLabel', { + defaultMessage: 'Hits (total)' + }), value: `${resp.hits.total}`, - description: 'The number of documents that match the query.', + description: i18n.translate('common.ui.courier.hitsTotalDescription', { + defaultMessage: 'The number of documents that match the query.' + }), }; - stats.Hits = { + stats.hits = { + label: i18n.translate('common.ui.courier.hitsLabel', { + defaultMessage: 'Hits' + }), value: `${resp.hits.hits.length}`, - description: 'The number of documents returned by the query.', + description: i18n.translate('common.ui.courier.hitsDescription', { + defaultMessage: 'The number of documents returned by the query.' + }), }; } if (lastRequest && (lastRequest.ms === 0 || lastRequest.ms)) { - stats['Request time'] = { - value: `${lastRequest.ms}ms`, - description: `The time of the request from the browser to Elasticsearch and back. - Does not include the time the requested waited in the queue.` + stats.requestTime = { + label: i18n.translate('common.ui.courier.requestTimeLabel', { + defaultMessage: 'Request time' + }), + value: i18n.translate('common.ui.courier.requestTimeValue', { + defaultMessage: '{requestTime}ms', + values: { requestTime: lastRequest.ms }, + }), + description: i18n.translate('common.ui.courier.requestTimeDescription', { + defaultMessage: 'The time of the request from the browser to Elasticsearch and back. ' + + 'Does not include the time the requested waited in the queue.' + }), }; } diff --git a/src/ui/public/inspector/adapters/request/request_adapter.test.ts b/src/ui/public/inspector/adapters/request/request_adapter.test.ts index 177baabdb443e..3f928c00533b0 100644 --- a/src/ui/public/inspector/adapters/request/request_adapter.test.ts +++ b/src/ui/public/inspector/adapters/request/request_adapter.test.ts @@ -72,7 +72,7 @@ describe('RequestAdapter', () => { expect(spy).toHaveBeenCalledTimes(1); req.json({ my: 'request' }); expect(spy).toHaveBeenCalledTimes(2); - req.stats({ foo: 42, bar: 'test' }); + req.stats({ foo: { label: 'Foo', value: 42 }, bar: { label: 'Bar', value: 'test' } }); expect(spy).toHaveBeenCalledTimes(3); req.ok({ json: {} }); expect(spy).toHaveBeenCalledTimes(4); diff --git a/src/ui/public/inspector/adapters/request/request_responder.ts b/src/ui/public/inspector/adapters/request/request_responder.ts index 00d3bd0da6202..31aa56030d874 100644 --- a/src/ui/public/inspector/adapters/request/request_responder.ts +++ b/src/ui/public/inspector/adapters/request/request_responder.ts @@ -46,10 +46,11 @@ export class RequestResponder { }; const startDate = new Date(this.request.startTime); - const timestampKey = i18n.translate('common.ui.inspector.reqTimestampKey', { - defaultMessage: 'Request timestamp', - }); - this.request.stats[timestampKey] = { + + this.request.stats.requestTimestamp = { + label: i18n.translate('common.ui.inspector.reqTimestampKey', { + defaultMessage: 'Request timestamp', + }), value: startDate.toISOString(), description: i18n.translate('common.ui.inspector.reqTimestampDescription', { defaultMessage: 'Time when the start of the request has been logged', diff --git a/src/ui/public/inspector/adapters/request/types.ts b/src/ui/public/inspector/adapters/request/types.ts index 16c9f8d0ab1ab..8718bf09fcb15 100644 --- a/src/ui/public/inspector/adapters/request/types.ts +++ b/src/ui/public/inspector/adapters/request/types.ts @@ -52,7 +52,11 @@ export interface RequestParams { } export interface RequestStatistics { - [key: string]: any; + [key: string]: { + label: string; + description?: string; + value: any; + }; } export interface Response { diff --git a/src/ui/public/saved_objects/components/saved_object_finder.js b/src/ui/public/saved_objects/components/saved_object_finder.js index 876b26d08a05e..395a24a3b5520 100644 --- a/src/ui/public/saved_objects/components/saved_object_finder.js +++ b/src/ui/public/saved_objects/components/saved_object_finder.js @@ -113,7 +113,8 @@ class SavedObjectFinderUI extends React.Component { search: filter ? `${filter}*` : undefined, page: 1, perPage: chrome.getUiSettingsClient().get('savedObjects:listingLimit'), - searchFields: ['title^3', 'description'] + searchFields: ['title^3', 'description'], + defaultSearchOperator: 'AND', }); if (this.props.savedObjectType === 'visualization' diff --git a/src/ui/public/saved_objects/saved_objects_client.js b/src/ui/public/saved_objects/saved_objects_client.js index c18a7276ab804..eba1acebabe4b 100644 --- a/src/ui/public/saved_objects/saved_objects_client.js +++ b/src/ui/public/saved_objects/saved_objects_client.js @@ -111,6 +111,7 @@ export class SavedObjectsClient { * @param {object} [options={}] * @property {string} options.type * @property {string} options.search + * @property {string} options.defaultSearchOperator * @property {string} options.searchFields - see Elasticsearch Simple Query String * Query field argument for more information * @property {integer} [options.page=1] diff --git a/src/ui/ui_render/bootstrap/template.js.hbs b/src/ui/ui_render/bootstrap/template.js.hbs index 2090f804fd935..2033a133c7ac8 100644 --- a/src/ui/ui_render/bootstrap/template.js.hbs +++ b/src/ui/ui_render/bootstrap/template.js.hbs @@ -15,7 +15,7 @@ window.onload = function () { err.style['text-align'] = 'center'; err.style['background'] = '#F44336'; err.style['padding'] = '25px'; - err.innerText = '{{i18n 'common.ui.welcomeError' '{"defaultMessage": "Kibana did not load properly. Check the server output for more information."}'}}'; + err.innerText = document.querySelector('[data-error-message]').dataset.errorMessage; document.body.innerHTML = err.outerHTML; } diff --git a/src/ui/ui_render/views/ui_app.pug b/src/ui/ui_render/views/ui_app.pug index df8e140c87a89..01626c5895f1e 100644 --- a/src/ui/ui_render/views/ui_app.pug +++ b/src/ui/ui_render/views/ui_app.pug @@ -107,7 +107,7 @@ block content .kibanaLoader .kibanaWelcomeLogoCircle .kibanaWelcomeLogo - .kibanaWelcomeText + .kibanaWelcomeText(data-error-message=i18n('common.ui.welcomeErrorMessage', { defaultMessage: 'Kibana did not load properly. Check the server output for more information.' })) | #{i18n('common.ui.welcomeMessage', { defaultMessage: 'Loading Kibana' })} script(src=bootstrapScriptUrl) diff --git a/src/ui/ui_settings/routes/__tests__/doc_exists.js b/src/ui/ui_settings/routes/__tests__/doc_exists.js index 2c03ab66e4983..3b1af1dea88c9 100644 --- a/src/ui/ui_settings/routes/__tests__/doc_exists.js +++ b/src/ui/ui_settings/routes/__tests__/doc_exists.js @@ -35,22 +35,12 @@ export function docExistsSuite() { const { kbnServer, uiSettings, callCluster } = getServices(); // delete the kibana index to ensure we start fresh - await callCluster('indices.delete', { + await callCluster('deleteByQuery', { index: kbnServer.config.get('kibana.index'), - ignore: [404] - }); - - // write a setting to create kibana index and savedConfig - await kbnServer.inject({ - method: 'POST', - url: '/api/kibana/settings/defaultIndex', - payload: { value: 'abc' } - }); - - // delete our defaultIndex setting to make doc empty - await kbnServer.inject({ - method: 'DELETE', - url: '/api/kibana/settings/defaultIndex', + body: { + conflicts: 'proceed', + query: { match_all: {} } + }, }); if (initialSettings) { diff --git a/src/ui/ui_settings/routes/__tests__/index.js b/src/ui/ui_settings/routes/__tests__/index.js index 5993ce0c38543..bf4db3602eee3 100644 --- a/src/ui/ui_settings/routes/__tests__/index.js +++ b/src/ui/ui_settings/routes/__tests__/index.js @@ -25,7 +25,6 @@ import { import { docExistsSuite } from './doc_exists'; import { docMissingSuite } from './doc_missing'; import { docMissingAndIndexReadOnlySuite } from './doc_missing_and_index_read_only'; -import { indexMissingSuite } from './index_missing'; describe('uiSettings/routes', function () { /** @@ -48,7 +47,6 @@ describe('uiSettings/routes', function () { this.timeout(10000); before(startServers); - describe('index missing', indexMissingSuite); describe('doc missing', docMissingSuite); describe('doc missing and index readonly', docMissingAndIndexReadOnlySuite); describe('doc exists', docExistsSuite); diff --git a/src/ui/ui_settings/routes/__tests__/index_missing.js b/src/ui/ui_settings/routes/__tests__/index_missing.js deleted file mode 100644 index 76955479ff1a2..0000000000000 --- a/src/ui/ui_settings/routes/__tests__/index_missing.js +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import expect from 'expect.js'; -import sinon from 'sinon'; - -import { - getServices, - chance, - assertSinonMatch, -} from './lib'; - -export function indexMissingSuite() { - async function setup() { - const { callCluster, kbnServer, deleteKibanaIndex } = getServices(); - const indexName = kbnServer.config.get('kibana.index'); - - // ensure the kibana index does not exist - await deleteKibanaIndex(callCluster); - - return { - kbnServer, - - // an incorrect number of shards is how we determine when the index was not created by Kibana, - // but automatically by writing to es when index didn't exist - async assertValidKibanaIndex() { - const resp = await callCluster('indices.get', { - index: indexName, - include_type_name: true, - }); - - expect(resp[indexName].mappings).to.have.property('doc'); - expect(resp[indexName].mappings.doc.properties).to.have.keys( - 'index-pattern', - 'visualization', - 'search', - 'dashboard' - ); - } - }; - } - - describe('get route', () => { - it('returns a 200 and creates doc, upgrades old value', async () => { - const { kbnServer } = await setup(); - - const { statusCode, result } = await kbnServer.inject({ - method: 'GET', - url: '/api/kibana/settings' - }); - - expect(statusCode).to.be(200); - assertSinonMatch(result, { - settings: { - buildNum: { - userValue: sinon.match.number, - }, - foo: { - userValue: 'bar', - isOverridden: true - } - } - }); - }); - }); - - describe('set route', () => { - it('returns a 200 and creates a valid kibana index', async () => { - const { kbnServer, assertValidKibanaIndex } = await setup(); - - const defaultIndex = chance.word(); - const { statusCode, result } = await kbnServer.inject({ - method: 'POST', - url: '/api/kibana/settings/defaultIndex', - payload: { - value: defaultIndex - } - }); - - expect(statusCode).to.be(200); - assertSinonMatch(result, { - settings: { - buildNum: { - userValue: sinon.match.number - }, - defaultIndex: { - userValue: defaultIndex - }, - foo: { - userValue: 'bar', - isOverridden: true - } - } - }); - - await assertValidKibanaIndex(); - }); - }); - - describe('setMany route', () => { - it('returns a 200 and creates a valid kibana index', async () => { - const { kbnServer, assertValidKibanaIndex } = await setup(); - - const defaultIndex = chance.word(); - const { statusCode, result } = await kbnServer.inject({ - method: 'POST', - url: '/api/kibana/settings', - payload: { - changes: { defaultIndex } - } - }); - - expect(statusCode).to.be(200); - assertSinonMatch(result, { - settings: { - buildNum: { - userValue: sinon.match.number - }, - defaultIndex: { - userValue: defaultIndex - }, - foo: { - userValue: 'bar', - isOverridden: true - } - } - }); - - await assertValidKibanaIndex(); - }); - }); - - describe('delete route', () => { - it('returns a 200 and creates a valid kibana index', async () => { - const { kbnServer, assertValidKibanaIndex } = await setup(); - - const { statusCode, result } = await kbnServer.inject({ - method: 'DELETE', - url: '/api/kibana/settings/defaultIndex' - }); - - expect(statusCode).to.be(200); - assertSinonMatch(result, { - settings: { - buildNum: { - userValue: sinon.match.number - }, - foo: { - userValue: 'bar', - isOverridden: true - } - } - }); - - await assertValidKibanaIndex(); - }); - }); -} diff --git a/test/api_integration/apis/saved_objects/migrations.js b/test/api_integration/apis/saved_objects/migrations.js index 540b5d0741633..260609d3b881e 100644 --- a/test/api_integration/apis/saved_objects/migrations.js +++ b/test/api_integration/apis/saved_objects/migrations.js @@ -219,14 +219,14 @@ async function createIndex({ callCluster, index }) { }; await callCluster('indices.create', { index, - body: { mappings: { doc: { dynamic: 'strict', properties } } }, + body: { mappings: { dynamic: 'strict', properties } }, }); } async function createDocs({ callCluster, index, docs }) { await callCluster('bulk', { body: docs.reduce((acc, doc) => { - acc.push({ index: { _id: doc.id, _index: index, _type: 'doc' } }); + acc.push({ index: { _id: doc.id, _index: index } }); acc.push(_.omit(doc, 'id')); return acc; }, []), @@ -259,7 +259,7 @@ async function migrateIndex({ callCluster, index, migrations, mappingProperties, async function fetchDocs({ callCluster, index }) { const { hits: { hits }, - } = await callCluster('search', { index, type: 'doc' }); + } = await callCluster('search', { index }); return hits.map(h => ({ ...h._source, id: h._id, diff --git a/test/api_integration/fixtures/es_archiver/elasticsearch/data.json.gz b/test/api_integration/fixtures/es_archiver/elasticsearch/data.json.gz index c2abd9bb72d0c..53ece34b9cfc1 100644 Binary files a/test/api_integration/fixtures/es_archiver/elasticsearch/data.json.gz and b/test/api_integration/fixtures/es_archiver/elasticsearch/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/elasticsearch/mappings.json b/test/api_integration/fixtures/es_archiver/elasticsearch/mappings.json index 2955741aeb7d4..65b3b3740cc56 100644 --- a/test/api_integration/fixtures/es_archiver/elasticsearch/mappings.json +++ b/test/api_integration/fixtures/es_archiver/elasticsearch/mappings.json @@ -8,8 +8,6 @@ "number_of_replicas": "1" } }, - "mappings": { - "doc": {} - } + "mappings": {} } } \ No newline at end of file diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/data.json.gz b/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/data.json.gz index 51f3d08846d37..edae3bfdaa2ea 100644 Binary files a/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/data.json.gz and b/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/mappings.json b/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/mappings.json index b47c0a003a42e..5d0d426010953 100644 --- a/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/mappings.json +++ b/test/api_integration/fixtures/es_archiver/index_patterns/basic_index/mappings.json @@ -9,25 +9,23 @@ } }, "mappings": { - "type": { - "properties": { - "bar": { - "type": "boolean" - }, - "baz": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "bar": { + "type": "boolean" + }, + "baz": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "foo": { - "type": "long" } + }, + "foo": { + "type": "long" } } } } -} +} \ No newline at end of file diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/data.json.gz b/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/data.json.gz index cf767f8331ef4..a2c25b53f22f4 100644 Binary files a/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/data.json.gz and b/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/mappings.json b/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/mappings.json index 98e62cf2462a0..c0f9e8266f35d 100644 --- a/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/mappings.json +++ b/test/api_integration/fixtures/es_archiver/index_patterns/conflicts/mappings.json @@ -9,20 +9,18 @@ } }, "mappings": { - "type": { - "properties": { - "@timestamp": { - "type": "date" - }, - "number_conflict": { - "type": "float" - }, - "string_conflict": { - "type": "keyword" - }, - "success": { - "type": "boolean" - } + "properties": { + "@timestamp": { + "type": "date" + }, + "number_conflict": { + "type": "float" + }, + "string_conflict": { + "type": "keyword" + }, + "success": { + "type": "boolean" } } } @@ -40,22 +38,20 @@ } }, "mappings": { - "type": { - "properties": { - "@timestamp": { - "type": "date" - }, - "number_conflict": { - "type": "integer" - }, - "string_conflict": { - "type": "text" - }, - "success": { - "type": "keyword" - } + "properties": { + "@timestamp": { + "type": "date" + }, + "number_conflict": { + "type": "integer" + }, + "string_conflict": { + "type": "text" + }, + "success": { + "type": "keyword" } } } } -} +} \ No newline at end of file diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/data.json.gz b/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/data.json.gz index 2e807e5c1fc31..cff0443dc3d53 100644 Binary files a/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/data.json.gz and b/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/mappings.json b/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/mappings.json index 20a55d612dff8..f24b3c4cf4c3f 100644 --- a/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/mappings.json +++ b/test/api_integration/fixtures/es_archiver/index_patterns/daily_index/mappings.json @@ -9,14 +9,12 @@ } }, "mappings": { - "type": { - "properties": { - "Jan01": { - "type": "boolean" - }, - "@timestamp": { - "type": "date" - } + "properties": { + "Jan01": { + "type": "boolean" + }, + "@timestamp": { + "type": "date" } } } @@ -34,14 +32,12 @@ } }, "mappings": { - "type": { - "properties": { - "Jan02": { - "type": "boolean" - }, - "@timestamp": { - "type": "date" - } + "properties": { + "Jan02": { + "type": "boolean" + }, + "@timestamp": { + "type": "date" } } } diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/data.json.gz b/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/data.json.gz index 3468514d621c5..1d7d1398e4541 100644 Binary files a/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/data.json.gz and b/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/mappings.json b/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/mappings.json index 054e9a7c851be..8485e1cb6450b 100644 --- a/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/mappings.json +++ b/test/api_integration/fixtures/es_archiver/index_patterns/time_based_indices/mappings.json @@ -9,14 +9,12 @@ } }, "mappings": { - "type": { - "properties": { - "count": { - "type": "long" - }, - "time": { - "type": "date" - } + "properties": { + "count": { + "type": "long" + }, + "time": { + "type": "date" } } } @@ -34,14 +32,12 @@ } }, "mappings": { - "type": { - "properties": { - "count": { - "type": "long" - }, - "time": { - "type": "date" - } + "properties": { + "count": { + "type": "long" + }, + "time": { + "type": "date" } } } @@ -59,14 +55,12 @@ } }, "mappings": { - "type": { - "properties": { - "count": { - "type": "long" - }, - "time": { - "type": "date" - } + "properties": { + "count": { + "type": "long" + }, + "time": { + "type": "date" } } } @@ -84,14 +78,12 @@ } }, "mappings": { - "type": { - "properties": { - "count": { - "type": "long" - }, - "time": { - "type": "date" - } + "properties": { + "count": { + "type": "long" + }, + "time": { + "type": "date" } } } @@ -109,14 +101,12 @@ } }, "mappings": { - "type": { - "properties": { - "count": { - "type": "long" - }, - "time": { - "type": "date" - } + "properties": { + "count": { + "type": "long" + }, + "time": { + "type": "date" } } } diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/data.json.gz b/test/api_integration/fixtures/es_archiver/management/saved_objects/data.json.gz index 3835470826ab6..0834567abb66b 100644 Binary files a/test/api_integration/fixtures/es_archiver/management/saved_objects/data.json.gz and b/test/api_integration/fixtures/es_archiver/management/saved_objects/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/mappings.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/mappings.json index 582e976c3cca0..c670508247b1a 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/mappings.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/mappings.json @@ -10,272 +10,270 @@ } }, "mappings": { - "doc": { - "dynamic": "strict", - "properties": { - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "dynamic": "strict", + "properties": { + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "telemetry:optIn": { - "type": "boolean" } + }, + "telemetry:optIn": { + "type": "boolean" } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "graph-workspace": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" } + }, + "numLinks": { + "type": "integer" + }, + "numVertices": { + "type": "integer" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "wsState": { + "type": "text" } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } } } diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/basic/data.json.gz b/test/api_integration/fixtures/es_archiver/saved_objects/basic/data.json.gz index ac2a10f42f4dc..c72f46370fa12 100644 Binary files a/test/api_integration/fixtures/es_archiver/saved_objects/basic/data.json.gz and b/test/api_integration/fixtures/es_archiver/saved_objects/basic/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/basic/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/basic/mappings.json index 4f3ead9f47c67..11a7e4cba7458 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/basic/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/basic/mappings.json @@ -9,247 +9,245 @@ } }, "mappings": { - "doc": { - "dynamic": "strict", - "properties": { - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "dynamic": "strict", + "properties": { + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "namespace": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "namespace": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } } } } } } -} +} \ No newline at end of file diff --git a/test/api_integration/fixtures/es_archiver/search/count/data.json.gz b/test/api_integration/fixtures/es_archiver/search/count/data.json.gz index e6fc50ad4f203..11f0b16c8b4db 100644 Binary files a/test/api_integration/fixtures/es_archiver/search/count/data.json.gz and b/test/api_integration/fixtures/es_archiver/search/count/data.json.gz differ diff --git a/test/api_integration/fixtures/es_archiver/search/count/mappings.json b/test/api_integration/fixtures/es_archiver/search/count/mappings.json index f4e480e9522b9..b62c5da05c2e6 100644 --- a/test/api_integration/fixtures/es_archiver/search/count/mappings.json +++ b/test/api_integration/fixtures/es_archiver/search/count/mappings.json @@ -9,234 +9,232 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + "properties": { + "type": { + "type": "keyword" + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } } } @@ -256,15 +254,13 @@ } }, "mappings": { - "bar": { - "properties": { - "foo": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "foo": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } @@ -284,15 +280,13 @@ } }, "mappings": { - "bar": { - "properties": { - "foo": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "foo": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } diff --git a/test/functional/apps/context/_filters.js b/test/functional/apps/context/_filters.js index 8cc65e7fc01d7..fe3a16d2d42f4 100644 --- a/test/functional/apps/context/_filters.js +++ b/test/functional/apps/context/_filters.js @@ -20,7 +20,7 @@ import expect from 'expect.js'; const TEST_INDEX_PATTERN = 'logstash-*'; -const TEST_ANCHOR_TYPE = 'doc'; +const TEST_ANCHOR_TYPE = '_doc'; const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI'; const TEST_ANCHOR_FILTER_FIELD = 'geo.src'; const TEST_ANCHOR_FILTER_VALUE = 'IN'; diff --git a/test/functional/apps/context/_size.js b/test/functional/apps/context/_size.js index 85c5d416514f7..3513a2fc53768 100644 --- a/test/functional/apps/context/_size.js +++ b/test/functional/apps/context/_size.js @@ -20,7 +20,7 @@ import expect from 'expect.js'; const TEST_INDEX_PATTERN = 'logstash-*'; -const TEST_ANCHOR_TYPE = 'doc'; +const TEST_ANCHOR_TYPE = '_doc'; const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI'; const TEST_DEFAULT_CONTEXT_SIZE = 7; const TEST_STEP_SIZE = 3; diff --git a/test/functional/apps/dashboard/_dashboard_listing.js b/test/functional/apps/dashboard/_dashboard_listing.js index 58c2ac379fa3c..2545ef1b4dae9 100644 --- a/test/functional/apps/dashboard/_dashboard_listing.js +++ b/test/functional/apps/dashboard/_dashboard_listing.js @@ -122,6 +122,12 @@ export default function ({ getService, getPageObjects }) { const countOfDashboards = await PageObjects.dashboard.getCountOfDashboardsInListingTable(); expect(countOfDashboards).to.equal(1); }); + + it('is using AND operator', async function () { + await PageObjects.dashboard.searchForDashboardWithName('three words'); + const countOfDashboards = await PageObjects.dashboard.getCountOfDashboardsInListingTable(); + expect(countOfDashboards).to.equal(0); + }); }); describe('search by title', function () { diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index 578f578c73d28..0f9a6b123aa5e 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -80,80 +80,7 @@ export default function ({ getService, getPageObjects }) { }); it('doc view should sort ascending', async function () { - - // Note: Could just check the timestamp, but might as well check that the whole doc is as expected. - const ExpectedDoc = - 'September 20th 2015, 00:00:00.000\ntype:apache index:logstash-2015.09.20 @timestamp:September 20th 2015, 00:00:00.000' - + ' ip:143.84.142.7 extension:jpg response:200 geo.coordinates:{ "lat": 38.68407028, "lon": -120.9871642 }' - + ' geo.src:ES geo.dest:US geo.srcdest:ES:US @tags:error, info utc_time:September 20th 2015, 00:00:00.000' - + ' referer:http://www.slate.com/success/vladimir-kovalyonok agent:Mozilla/4.0 (compatible; MSIE 6.0;' - + ' Windows NT 5.1; SV1; .NET CLR 1.1.4322) clientip:143.84.142.7 bytes:1,623' - + ' host:media-for-the-masses.theacademyofperformingartsandscience.org request:/uploads/steven-hawley.jpg' - + ' url:https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/steven-hawley.jpg' - + ' @message:143.84.142.7 - - [2015-09-20T00:00:00.000Z] "GET /uploads/steven-hawley.jpg HTTP/1.1" 200' - + ' 1623 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" spaces:this is a' - + ' thing with lots of spaces wwwwoooooo xss:' - + ' headings:

kimiya-yui

, http://www.slate.com/success/koichi-wakata' - + ' links:thomas-marshburn@twitter.com, http://www.slate.com/info/michael-p-anderson, www.twitter.com' - + ' relatedContent:{ "url":' - + ' "http://www.laweekly.com/music/jay-electronica-much-better-than-his-name-would-suggest-2412364",' - + ' "og:type": "article", "og:title": "Jay Electronica: Much Better Than His Name Would Suggest",' - + ' "og:description": "You may not know who Jay Electronica is yet, but I'm willing to bet that you' - + ' would had he chosen a better name. Jay Electronica does not sound like the ...", "og:url":' - + ' "http://www.laweekly.com/music/jay-electronica-much-better-than-his-name-would-suggest-2412364",' - + ' "article:published_time": "2008-04-04T16:00:00-07:00", "article:modified_time":' - + ' "2014-11-27T08:01:03-08:00", "article:section": "Music", "og:site_name": "LA Weekly", "twitter:title":' - + ' "Jay Electronica: Much Better Than His Name Would Suggest", "twitter:description": "You may not know' - + ' who Jay Electronica is yet, but I'm willing to bet that you would had he chosen a better name.' - + ' Jay Electronica does not sound like the ...", "twitter:card": "summary", "twitter:site": "@laweekly"' - + ' }, { "url": "http://www.laweekly.com/news/mandoe-on-gower-near-fountain-2368123", "og:type":' - + ' "article", "og:title": "MANDOE On Gower Near Fountain", "og:description": "MANDOE has a stunner on a' - + ' wall north of an east-west street crossing Gower around Fountain (but not on Fountain). MADNOE, PROSE' - + ' and FUKM are listed on t...", "og:url": "' - + 'http://www.laweekly.com/news/mandoe-on-gower-near-fountain-2368123", "article:published_time":' - + ' "2008-04-25T07:26:41-07:00", "article:modified_time": "2014-10-28T15:00:08-07:00", "article:section":' - + ' "News", "og:image": "' - + 'http://images1.laweekly.com/imager/mandoe-on-gower-near-fountain/u/original/2430891/img_6648.jpg",' - + ' "og:image:height": "640", "og:image:width": "480", "og:site_name": "LA Weekly", "twitter:title": ' - + '"MANDOE On Gower Near Fountain", "twitter:description": "MANDOE has a stunner on a wall north of an' - + ' east-west street crossing Gower around Fountain (but not on Fountain). MADNOE, PROSE and FUKM are' - + ' listed on t...", "twitter:card": "summary", "twitter:image": "' - + 'http://images1.laweekly.com/imager/mandoe-on-gower-near-fountain/u/original/2430891/img_6648.jpg", ' - + '"twitter:site": "@laweekly" }, { "url": "http://www.laweekly.com/arts/meghan-finds-the-love-2373346",' - + ' "og:type": "article", "og:title": "Meghan Finds The Love", "og:description": "LA Weekly is the' - + ' definitive source of information for news, music, movies, restaurants, reviews, and events in Los' - + ' Angeles.", "og:url": "http://www.laweekly.com/arts/meghan-finds-the-love-2373346",' - + ' "article:published_time": "2005-10-20T18:10:25-07:00", "article:modified_time":' - + ' "2014-11-25T19:52:35-08:00", "article:section": "Arts", "og:site_name": "LA Weekly", "twitter:title":' - + ' "Meghan Finds The Love", "twitter:description": "LA Weekly is the definitive source of information for' - + ' news, music, movies, restaurants, reviews, and events in Los Angeles.", "twitter:card": "summary",' - + ' "twitter:site": "@laweekly" }, { "url": "http://www.laweekly.com/arts/these-clowns-are-with-me-2371051' - + '", "og:type": "article", "og:title": "These Clowns Are With Me", "og:description": "    I' - + ' didn't mean to blow off all my responsibilities yesterday, but when a schmoozy Hollywood luncheon' - + ' turns into a full-on party by 3pm, and...", "og:url": "' - + 'http://www.laweekly.com/arts/these-clowns-are-with-me-2371051", "article:published_time": ' - + '"2006-03-04T17:03:42-08:00", "article:modified_time": "2014-11-25T17:05:47-08:00", "article:section":' - + ' "Arts", "og:image": "' - + 'http://images1.laweekly.com/imager/these-clowns-are-with-me/u/original/2434556/e4b8scd.jpg",' - + ' "og:image:height": "375", "og:image:width": "500", "og:site_name": "LA Weekly", "twitter:title":' - + ' "These Clowns Are With Me", "twitter:description": "    I didn't mean to blow off all' - + ' my responsibilities yesterday, but when a schmoozy Hollywood luncheon turns into a full-on party by' - + ' 3pm, and...", "twitter:card": "summary", "twitter:image": "' - + 'http://images1.laweekly.com/imager/these-clowns-are-with-me/u/original/2434556/e4b8scd.jpg",' - + ' "twitter:site": "@laweekly" }, { "url": "http://www.laweekly.com/arts/shopping-daze-2373807",' - + ' "og:type": "article", "og:title": "Shopping Daze", "og:description": "LA Weekly is the definitive ' - + 'source of information for news, music, movies, restaurants, reviews, and events in Los Angeles.",' - + ' "og:url": "http://www.laweekly.com/arts/shopping-daze-2373807", "article:published_time":' - + ' "2006-12-13T12:12:04-08:00", "article:modified_time": "2014-11-25T20:15:21-08:00", "article:section":' - + ' "Arts", "og:site_name": "LA Weekly", "twitter:title": "Shopping Daze", "twitter:description": "LA' - + ' Weekly is the definitive source of information for news, music, movies, restaurants, reviews, and' - + ' events in Los Angeles.", "twitter:card": "summary", "twitter:site": "@laweekly" } machine.os:osx' - + ' machine.ram:15,032,385,536 _id:AU_x3_g3GFA8no6QjkFm _type:doc _index:logstash-2015.09.20 _score: -' - + ' relatedContent.article:modified_time:October 28th 2014, 22:00:08.000, November 26th 2014,' - + ' 01:05:47.000, November 26th 2014, 03:52:35.000, November 26th 2014, 04:15:21.000, November 27th 2014,' - + ' 16:01:03.000 relatedContent.article:published_time:October 21st 2005, 01:10:25.000, March 5th 2006,' - + ' 01:03:42.000, December 13th 2006, 20:12:04.000, April 4th 2008, 23:00:00.000, April 25th 2008,' - + ' 14:26:41.000'; + const expectedTimeStamp = 'September 20th 2015, 00:00:00.000'; await PageObjects.discover.clickDocSortDown(); // we don't technically need this sleep here because the tryForTime will retry and the @@ -162,7 +89,8 @@ export default function ({ getService, getPageObjects }) { await PageObjects.common.sleep(2000); await retry.try(async function tryingForTime() { const rowData = await PageObjects.discover.getDocTableIndex(1); - expect(rowData).to.be(ExpectedDoc); + + expect(rowData.startsWith(expectedTimeStamp)).to.be.ok(); }); }); diff --git a/test/functional/apps/management/_handle_version_conflict.js b/test/functional/apps/management/_handle_version_conflict.js index c66b59fb00380..b648b343392ed 100644 --- a/test/functional/apps/management/_handle_version_conflict.js +++ b/test/functional/apps/management/_handle_version_conflict.js @@ -56,7 +56,7 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.setScriptedFieldScript(`doc['bytes'].value`); const response = await es.update({ index: '.kibana', - type: 'doc', + type: '_doc', id: 'index-pattern:logstash-*', body: { 'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.src":{"id":"number"}}' } } @@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.setFieldFormat('url'); const response = await es.update({ index: '.kibana', - type: 'doc', + type: '_doc', id: 'index-pattern:logstash-*', body: { 'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.dest":{"id":"number"}}' } } diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index cfb89790ad5e9..fd5153e0831fe 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }) { describe('creating and deleting default index', function describeIndexTests() { before(function () { - // delete .kibana index and then wait for Kibana to re-create it + // Delete .kibana index and then wait for Kibana to re-create it return kibanaServer.uiSettings.replace({}) .then(function () { return PageObjects.settings.navigateTo(); diff --git a/test/functional/fixtures/es_archiver/alias/data.json.gz b/test/functional/fixtures/es_archiver/alias/data.json.gz index 1ab2205ca11cd..9bd617a354da9 100644 Binary files a/test/functional/fixtures/es_archiver/alias/data.json.gz and b/test/functional/fixtures/es_archiver/alias/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/alias/mappings.json b/test/functional/fixtures/es_archiver/alias/mappings.json index c99333d8e4b8a..cac1eb69ed571 100644 --- a/test/functional/fixtures/es_archiver/alias/mappings.json +++ b/test/functional/fixtures/es_archiver/alias/mappings.json @@ -9,15 +9,13 @@ } }, "mappings": { - "doc": { - "properties": { - "message": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "message": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } @@ -37,11 +35,9 @@ } }, "mappings": { - "doc": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } @@ -59,15 +55,13 @@ } }, "mappings": { - "doc": { - "properties": { - "message": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "message": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } @@ -87,15 +81,13 @@ } }, "mappings": { - "doc": { - "properties": { - "message": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "message": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } @@ -115,11 +107,9 @@ } }, "mappings": { - "doc": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } @@ -137,11 +127,9 @@ } }, "mappings": { - "doc": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } @@ -159,11 +147,9 @@ } }, "mappings": { - "doc": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } @@ -181,11 +167,9 @@ } }, "mappings": { - "doc": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } @@ -203,15 +187,13 @@ } }, "mappings": { - "doc": { - "properties": { - "message": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "message": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } diff --git a/test/functional/fixtures/es_archiver/dashboard/current/data/data.json.gz b/test/functional/fixtures/es_archiver/dashboard/current/data/data.json.gz index 25b0a5df46de8..efad674a84458 100644 Binary files a/test/functional/fixtures/es_archiver/dashboard/current/data/data.json.gz and b/test/functional/fixtures/es_archiver/dashboard/current/data/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/dashboard/current/data/mappings.json b/test/functional/fixtures/es_archiver/dashboard/current/data/mappings.json index b542023864130..1be58a3249c05 100644 --- a/test/functional/fixtures/es_archiver/dashboard/current/data/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/current/data/mappings.json @@ -9,41 +9,39 @@ } }, "mappings": { - "data": { - "properties": { - "@timestamp": { - "type": "date" - }, - "animal": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "@timestamp": { + "type": "date" + }, + "animal": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "name": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "sound": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "sound": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "weightLbs": { - "type": "long" } + }, + "weightLbs": { + "type": "long" } } } @@ -61,41 +59,39 @@ } }, "mappings": { - "data": { - "properties": { - "@timestamp": { - "type": "date" - }, - "animal": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "@timestamp": { + "type": "date" + }, + "animal": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "name": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "sound": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "sound": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "weightLbs": { - "type": "long" } + }, + "weightLbs": { + "type": "long" } } } @@ -113,41 +109,39 @@ } }, "mappings": { - "data": { - "properties": { - "@timestamp": { - "type": "date" - }, - "animal": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "@timestamp": { + "type": "date" + }, + "animal": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "name": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "sound": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "sound": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "weightLbs": { - "type": "long" } + }, + "weightLbs": { + "type": "long" } } } @@ -165,41 +159,39 @@ } }, "mappings": { - "data": { - "properties": { - "@timestamp": { - "type": "date" - }, - "animal": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "@timestamp": { + "type": "date" + }, + "animal": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "name": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "sound": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "sound": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "weightLbs": { - "type": "long" } + }, + "weightLbs": { + "type": "long" } } } @@ -217,35 +209,33 @@ } }, "mappings": { - "data": { - "properties": { - "activity level": { - "type": "long" - }, - "barking level": { - "type": "long" - }, - "breed": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "activity level": { + "type": "long" + }, + "barking level": { + "type": "long" + }, + "breed": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "size": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "size": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "trainability": { - "type": "long" } + }, + "trainability": { + "type": "long" } } } @@ -272,342 +262,340 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" + } + }, + "type": "text" } } - ], - "properties": { - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + ], + "properties": { + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ram": { - "type": "long" } + }, + "ram": { + "type": "long" } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } } } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } diff --git a/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz b/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz index 68705c9d6a2b9..8e7b633767112 100644 Binary files a/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz and b/test/functional/fixtures/es_archiver/dashboard/current/kibana/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json b/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json index 57a732b9f86a6..09292fdbb6169 100644 --- a/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json @@ -10,265 +10,263 @@ } }, "mappings": { - "doc": { - "dynamic": "strict", - "properties": { - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "dynamic": "strict", + "properties": { + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "notifications:lifetime:banner": { - "type": "long" - }, - "notifications:lifetime:error": { - "type": "long" - }, - "notifications:lifetime:info": { - "type": "long" - }, - "notifications:lifetime:warning": { - "type": "long" } + }, + "notifications:lifetime:banner": { + "type": "long" + }, + "notifications:lifetime:error": { + "type": "long" + }, + "notifications:lifetime:info": { + "type": "long" + }, + "notifications:lifetime:warning": { + "type": "long" } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } } } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/dashboard/legacy/data.json.gz b/test/functional/fixtures/es_archiver/dashboard/legacy/data.json.gz index 47dbe12141ded..269752cdbde21 100644 Binary files a/test/functional/fixtures/es_archiver/dashboard/legacy/data.json.gz and b/test/functional/fixtures/es_archiver/dashboard/legacy/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json index 9f9d9bf53aa43..8f31ca9eaeb51 100644 --- a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json @@ -9,232 +9,230 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + "properties": { + "type": { + "type": "keyword" + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } diff --git a/test/functional/fixtures/es_archiver/discover/data.json.gz b/test/functional/fixtures/es_archiver/discover/data.json.gz index 020ca814620a8..738678da3f4cc 100644 Binary files a/test/functional/fixtures/es_archiver/discover/data.json.gz and b/test/functional/fixtures/es_archiver/discover/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/discover/mappings.json b/test/functional/fixtures/es_archiver/discover/mappings.json index 1531fa4605d9d..eaa408fc08587 100644 --- a/test/functional/fixtures/es_archiver/discover/mappings.json +++ b/test/functional/fixtures/es_archiver/discover/mappings.json @@ -9,234 +9,232 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + "properties": { + "type": { + "type": "keyword" + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } } } diff --git a/test/functional/fixtures/es_archiver/empty_kibana/data.json.gz b/test/functional/fixtures/es_archiver/empty_kibana/data.json.gz index bffef555b9bf3..2702663778331 100644 Binary files a/test/functional/fixtures/es_archiver/empty_kibana/data.json.gz and b/test/functional/fixtures/es_archiver/empty_kibana/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json index fdde0dafde90c..7550d9f87195c 100644 --- a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json +++ b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json @@ -9,241 +9,239 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + "properties": { + "type": { + "type": "keyword" + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } diff --git a/test/functional/fixtures/es_archiver/getting_started/shakespeare/data.json.gz b/test/functional/fixtures/es_archiver/getting_started/shakespeare/data.json.gz index 9eb2b6af5b3a8..1e43f7181bed6 100644 Binary files a/test/functional/fixtures/es_archiver/getting_started/shakespeare/data.json.gz and b/test/functional/fixtures/es_archiver/getting_started/shakespeare/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/getting_started/shakespeare/mappings.json b/test/functional/fixtures/es_archiver/getting_started/shakespeare/mappings.json index 0f021612cd77e..d59c84d523cd7 100644 --- a/test/functional/fixtures/es_archiver/getting_started/shakespeare/mappings.json +++ b/test/functional/fixtures/es_archiver/getting_started/shakespeare/mappings.json @@ -9,14 +9,20 @@ } }, "mappings": { - "doc": { - "properties": { - "speaker": {"type": "keyword"}, - "play_name": {"type": "keyword"}, - "line_id": {"type": "integer"}, - "speech_number": {"type": "integer"} + "properties": { + "speaker": { + "type": "keyword" + }, + "play_name": { + "type": "keyword" + }, + "line_id": { + "type": "integer" + }, + "speech_number": { + "type": "integer" } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/hamlet/data.json.gz b/test/functional/fixtures/es_archiver/hamlet/data.json.gz index ae267411833cb..f58f477116d6d 100644 Binary files a/test/functional/fixtures/es_archiver/hamlet/data.json.gz and b/test/functional/fixtures/es_archiver/hamlet/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/hamlet/mappings.json b/test/functional/fixtures/es_archiver/hamlet/mappings.json index 491ab9ad916af..d6903fb5ce50d 100644 --- a/test/functional/fixtures/es_archiver/hamlet/mappings.json +++ b/test/functional/fixtures/es_archiver/hamlet/mappings.json @@ -9,19 +9,17 @@ } }, "mappings": { - "test": { - "properties": { - "mybook": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "properties": { + "mybook": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/invalid_scripted_field/data.json.gz b/test/functional/fixtures/es_archiver/invalid_scripted_field/data.json.gz index 5acc2bcbd1d9a..d91c454edb8dd 100644 Binary files a/test/functional/fixtures/es_archiver/invalid_scripted_field/data.json.gz and b/test/functional/fixtures/es_archiver/invalid_scripted_field/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json index 163ae61e18c72..885a5e776d0b7 100644 --- a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json +++ b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json @@ -9,244 +9,242 @@ } }, "mappings": { - "doc": { - "dynamic": "strict", - "properties": { - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "dynamic": "strict", + "properties": { + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } } } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/kibana_sample_data_flights/data.json.gz b/test/functional/fixtures/es_archiver/kibana_sample_data_flights/data.json.gz index c8c23dd5c1440..88a6a933dfcb5 100644 Binary files a/test/functional/fixtures/es_archiver/kibana_sample_data_flights/data.json.gz and b/test/functional/fixtures/es_archiver/kibana_sample_data_flights/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/kibana_sample_data_flights/mappings.json b/test/functional/fixtures/es_archiver/kibana_sample_data_flights/mappings.json index 94212aeadb288..3e1eebd3c5d70 100644 --- a/test/functional/fixtures/es_archiver/kibana_sample_data_flights/mappings.json +++ b/test/functional/fixtures/es_archiver/kibana_sample_data_flights/mappings.json @@ -9,89 +9,87 @@ } }, "mappings": { - "_doc": { - "properties": { - "AvgTicketPrice": { - "type": "float" - }, - "Cancelled": { - "type": "boolean" - }, - "Carrier": { - "type": "keyword" - }, - "Dest": { - "type": "keyword" - }, - "DestAirportID": { - "type": "keyword" - }, - "DestCityName": { - "type": "keyword" - }, - "DestCountry": { - "type": "keyword" - }, - "DestLocation": { - "type": "geo_point" - }, - "DestRegion": { - "type": "keyword" - }, - "DestWeather": { - "type": "keyword" - }, - "DistanceKilometers": { - "type": "float" - }, - "DistanceMiles": { - "type": "float" - }, - "FlightDelay": { - "type": "boolean" - }, - "FlightDelayMin": { - "type": "integer" - }, - "FlightDelayType": { - "type": "keyword" - }, - "FlightNum": { - "type": "keyword" - }, - "FlightTimeHour": { - "type": "keyword" - }, - "FlightTimeMin": { - "type": "float" - }, - "Origin": { - "type": "keyword" - }, - "OriginAirportID": { - "type": "keyword" - }, - "OriginCityName": { - "type": "keyword" - }, - "OriginCountry": { - "type": "keyword" - }, - "OriginLocation": { - "type": "geo_point" - }, - "OriginRegion": { - "type": "keyword" - }, - "OriginWeather": { - "type": "keyword" - }, - "dayOfWeek": { - "type": "integer" - }, - "timestamp": { - "type": "date" - } + "properties": { + "AvgTicketPrice": { + "type": "float" + }, + "Cancelled": { + "type": "boolean" + }, + "Carrier": { + "type": "keyword" + }, + "Dest": { + "type": "keyword" + }, + "DestAirportID": { + "type": "keyword" + }, + "DestCityName": { + "type": "keyword" + }, + "DestCountry": { + "type": "keyword" + }, + "DestLocation": { + "type": "geo_point" + }, + "DestRegion": { + "type": "keyword" + }, + "DestWeather": { + "type": "keyword" + }, + "DistanceKilometers": { + "type": "float" + }, + "DistanceMiles": { + "type": "float" + }, + "FlightDelay": { + "type": "boolean" + }, + "FlightDelayMin": { + "type": "integer" + }, + "FlightDelayType": { + "type": "keyword" + }, + "FlightNum": { + "type": "keyword" + }, + "FlightTimeHour": { + "type": "keyword" + }, + "FlightTimeMin": { + "type": "float" + }, + "Origin": { + "type": "keyword" + }, + "OriginAirportID": { + "type": "keyword" + }, + "OriginCityName": { + "type": "keyword" + }, + "OriginCountry": { + "type": "keyword" + }, + "OriginLocation": { + "type": "geo_point" + }, + "OriginRegion": { + "type": "keyword" + }, + "OriginWeather": { + "type": "keyword" + }, + "dayOfWeek": { + "type": "integer" + }, + "timestamp": { + "type": "date" } } }, diff --git a/test/functional/fixtures/es_archiver/large_fields/data.json.gz b/test/functional/fixtures/es_archiver/large_fields/data.json.gz index 619281a9d76e5..a7ea4a3ce80b8 100644 Binary files a/test/functional/fixtures/es_archiver/large_fields/data.json.gz and b/test/functional/fixtures/es_archiver/large_fields/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/large_fields/mappings.json b/test/functional/fixtures/es_archiver/large_fields/mappings.json index 25f7d1061b840..a6795d4d3e6e6 100644 --- a/test/functional/fixtures/es_archiver/large_fields/mappings.json +++ b/test/functional/fixtures/es_archiver/large_fields/mappings.json @@ -14,13 +14,11 @@ } }, "mappings": { - "test": { - "properties": { - "date": { - "type": "date" - } + "properties": { + "date": { + "type": "date" } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/logstash_functional/data.json.gz b/test/functional/fixtures/es_archiver/logstash_functional/data.json.gz index 561decae04c16..5ea7e140d95d1 100644 Binary files a/test/functional/fixtures/es_archiver/logstash_functional/data.json.gz and b/test/functional/fixtures/es_archiver/logstash_functional/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/logstash_functional/mappings.json b/test/functional/fixtures/es_archiver/logstash_functional/mappings.json index 8a7a5a063eb41..b1a25cff2b863 100644 --- a/test/functional/fixtures/es_archiver/logstash_functional/mappings.json +++ b/test/functional/fixtures/es_archiver/logstash_functional/mappings.json @@ -18,345 +18,343 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" + } + }, + "type": "text" } } - ], - "properties": { - "type": { - "type": "keyword" - }, - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + ], + "properties": { + "type": { + "type": "keyword" + }, + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ram": { - "type": "long" } + }, + "ram": { + "type": "long" } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } } } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } @@ -385,345 +383,343 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" + } + }, + "type": "text" } } - ], - "properties": { - "type": { - "type": "keyword" - }, - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + ], + "properties": { + "type": { + "type": "keyword" + }, + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ram": { - "type": "long" } + }, + "ram": { + "type": "long" } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } } } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } @@ -752,349 +748,347 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" + } + }, + "type": "text" } } - ], - "properties": { - "type": { - "type": "keyword" - }, - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + ], + "properties": { + "type": { + "type": "keyword" + }, + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "ram": { - "type": "long" } + }, + "ram": { + "type": "long" } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } } } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/makelogs/data.json.gz b/test/functional/fixtures/es_archiver/makelogs/data.json.gz index 504eafc6cf8a1..d3328701ec972 100644 Binary files a/test/functional/fixtures/es_archiver/makelogs/data.json.gz and b/test/functional/fixtures/es_archiver/makelogs/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/makelogs/mappings.json b/test/functional/fixtures/es_archiver/makelogs/mappings.json index 1b5251ead9934..0d958043133eb 100644 --- a/test/functional/fixtures/es_archiver/makelogs/mappings.json +++ b/test/functional/fixtures/es_archiver/makelogs/mappings.json @@ -18,345 +18,343 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } - } - } - ], - "properties": { - "type": { - "type": "keyword" - }, - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } - } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "ram": { - "type": "long" - } - } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } - } - } - } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" } }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + "type": "text" + } + } + } + ], + "properties": { + "type": { + "type": "keyword" + }, + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" + } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ram": { + "type": "long" + } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } @@ -385,349 +383,347 @@ } }, "mappings": { - "doc": { - "dynamic_templates": [ - { - "string_fields": { - "match": "*", - "match_mapping_type": "string", - "mapping": { - "fields": { - "raw": { - "type": "keyword" - } - }, - "type": "text" - } - } - } - ], - "properties": { - "type": { - "type": "keyword" - }, - "@message": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "@tags": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "@timestamp": { - "type": "date" - }, - "agent": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "bytes": { - "type": "long" - }, - "clientip": { - "type": "ip" - }, - "extension": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - }, - "dest": { - "type": "keyword" - }, - "src": { - "type": "keyword" - }, - "srcdest": { - "type": "keyword" - } - } - }, - "headings": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "host": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "id": { - "type": "integer" - }, - "index": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "ip": { - "type": "ip" - }, - "links": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "machine": { - "properties": { - "os": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "ram": { - "type": "long" - } - } - }, - "memory": { - "type": "double" - }, - "meta": { - "properties": { - "char": { - "type": "keyword" - }, - "related": { - "type": "text" - }, - "user": { - "properties": { - "firstname": { - "type": "text" - }, - "lastname": { - "type": "integer" - } - } - } - } - }, - "phpmemory": { - "type": "long" - }, - "referer": { - "type": "keyword" - }, - "relatedContent": { - "properties": { - "article:modified_time": { - "type": "date" - }, - "article:published_time": { - "type": "date" - }, - "article:section": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "article:tag": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "fields": { + "raw": { + "type": "keyword" } }, - "og:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:image:height": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:image:width": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:site_name": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:type": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "og:url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } - } - }, - "twitter:card": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + "type": "text" + } + } + } + ], + "properties": { + "type": { + "type": "keyword" + }, + "@message": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "@tags": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "clientip": { + "type": "ip" + }, + "extension": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + }, + "dest": { + "type": "keyword" + }, + "src": { + "type": "keyword" + }, + "srcdest": { + "type": "keyword" + } + } + }, + "headings": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "host": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "id": { + "type": "integer" + }, + "index": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "links": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "machine": { + "properties": { + "os": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:description": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "ram": { + "type": "long" + } + } + }, + "memory": { + "type": "double" + }, + "meta": { + "properties": { + "char": { + "type": "keyword" + }, + "related": { + "type": "text" + }, + "user": { + "properties": { + "firstname": { + "type": "text" + }, + "lastname": { + "type": "integer" } - }, - "twitter:image": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + } + } + }, + "phpmemory": { + "type": "long" + }, + "referer": { + "type": "keyword" + }, + "relatedContent": { + "properties": { + "article:modified_time": { + "type": "date" + }, + "article:published_time": { + "type": "date" + }, + "article:section": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "article:tag": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image:height": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:image:width": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:site_name": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:type": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "og:url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:card": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:description": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" + } + } + }, + "twitter:image": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:site": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:site": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "twitter:title": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "twitter:title": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } - }, - "request": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "request": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "response": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "response": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "spaces": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "spaces": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "url": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "url": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } - }, - "utc_time": { - "type": "date" - }, - "xss": { - "type": "text", - "fields": { - "raw": { - "type": "keyword" - } + } + }, + "utc_time": { + "type": "date" + }, + "xss": { + "type": "text", + "fields": { + "raw": { + "type": "keyword" } } } } } } -} +} \ No newline at end of file diff --git a/test/functional/fixtures/es_archiver/management/data.json.gz b/test/functional/fixtures/es_archiver/management/data.json.gz index fd4fd89be6eeb..2d8fee5a4ccca 100644 Binary files a/test/functional/fixtures/es_archiver/management/data.json.gz and b/test/functional/fixtures/es_archiver/management/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/management/mappings.json b/test/functional/fixtures/es_archiver/management/mappings.json index 375a2fdafd60b..a6839693d667e 100644 --- a/test/functional/fixtures/es_archiver/management/mappings.json +++ b/test/functional/fixtures/es_archiver/management/mappings.json @@ -9,234 +9,232 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + "properties": { + "type": { + "type": "keyword" + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } } } diff --git a/test/functional/fixtures/es_archiver/mgmt/data.json.gz b/test/functional/fixtures/es_archiver/mgmt/data.json.gz index d923b3a74e474..1f83c56b1aefd 100644 Binary files a/test/functional/fixtures/es_archiver/mgmt/data.json.gz and b/test/functional/fixtures/es_archiver/mgmt/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/mgmt/mappings.json b/test/functional/fixtures/es_archiver/mgmt/mappings.json index 107a45fab187b..81058cf820733 100644 --- a/test/functional/fixtures/es_archiver/mgmt/mappings.json +++ b/test/functional/fixtures/es_archiver/mgmt/mappings.json @@ -10,269 +10,267 @@ } }, "mappings": { - "doc": { - "dynamic": "strict", - "properties": { - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + "dynamic": "strict", + "properties": { + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "graph-workspace": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" } + }, + "numLinks": { + "type": "integer" + }, + "numVertices": { + "type": "integer" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "wsState": { + "type": "text" } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } } } diff --git a/test/functional/fixtures/es_archiver/timelion/data.json.gz b/test/functional/fixtures/es_archiver/timelion/data.json.gz index 6bf3a8ed214cc..bbeffa227ad68 100644 Binary files a/test/functional/fixtures/es_archiver/timelion/data.json.gz and b/test/functional/fixtures/es_archiver/timelion/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/timelion/mappings.json b/test/functional/fixtures/es_archiver/timelion/mappings.json index 9f9d9bf53aa43..8f31ca9eaeb51 100644 --- a/test/functional/fixtures/es_archiver/timelion/mappings.json +++ b/test/functional/fixtures/es_archiver/timelion/mappings.json @@ -9,232 +9,230 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + "properties": { + "type": { + "type": "keyword" + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } diff --git a/test/functional/fixtures/es_archiver/visualize/data.json.gz b/test/functional/fixtures/es_archiver/visualize/data.json.gz index fc520fc2b682d..b61eb5c0adc84 100644 Binary files a/test/functional/fixtures/es_archiver/visualize/data.json.gz and b/test/functional/fixtures/es_archiver/visualize/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/visualize/mappings.json b/test/functional/fixtures/es_archiver/visualize/mappings.json index 375a2fdafd60b..a6839693d667e 100644 --- a/test/functional/fixtures/es_archiver/visualize/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize/mappings.json @@ -9,234 +9,232 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + "properties": { + "type": { + "type": "keyword" + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } } } diff --git a/test/functional/fixtures/es_archiver/visualize_embedding/data.json.gz b/test/functional/fixtures/es_archiver/visualize_embedding/data.json.gz index 31001f860a951..2aeffb5a492e5 100644 Binary files a/test/functional/fixtures/es_archiver/visualize_embedding/data.json.gz and b/test/functional/fixtures/es_archiver/visualize_embedding/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json index 375a2fdafd60b..a6839693d667e 100644 --- a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json @@ -9,234 +9,232 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + "properties": { + "type": { + "type": "keyword" + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } } } diff --git a/test/functional/fixtures/es_archiver/visualize_source-filters/data.json.gz b/test/functional/fixtures/es_archiver/visualize_source-filters/data.json.gz index 084cccf7330ae..a3310c296f582 100644 Binary files a/test/functional/fixtures/es_archiver/visualize_source-filters/data.json.gz and b/test/functional/fixtures/es_archiver/visualize_source-filters/data.json.gz differ diff --git a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json index cf09df590e157..2dffb9ceba847 100644 --- a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json @@ -9,232 +9,230 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + "properties": { + "type": { + "type": "keyword" + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + } + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } diff --git a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json index 92b5cd8d67745..160c062c3e6d7 100644 --- a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json @@ -9,252 +9,250 @@ } }, "mappings": { - "doc": { - "properties": { - "type": { - "type": "keyword" - }, - "index-pattern": { - "dynamic": "strict", - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - } + "properties": { + "type": { + "type": "keyword" + }, + "index-pattern": { + "dynamic": "strict", + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" } - }, - "server": { - "dynamic": "strict", - "properties": { - "uuid": { - "type": "keyword" - } + } + }, + "server": { + "dynamic": "strict", + "properties": { + "uuid": { + "type": "keyword" } - }, - "dashboard": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "dashboard": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "search": { - "dynamic": "strict", - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "search": { + "dynamic": "strict", + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } - }, - "url": { - "dynamic": "strict", - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 2048 - } + } + }, + "url": { + "dynamic": "strict", + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 } } } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } - }, - "defaultIndex": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } + } + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 } } } - }, - "visualization": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "visualization": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "savedSearchId": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" } - }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } + } + }, + "timelion-sheet": { + "dynamic": "strict", + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" } } } diff --git a/test/functional/page_objects/context_page.js b/test/functional/page_objects/context_page.js index af6a7c26dbe14..4e2745d2c11ad 100644 --- a/test/functional/page_objects/context_page.js +++ b/test/functional/page_objects/context_page.js @@ -44,6 +44,8 @@ export function ContextPageProvider({ getService, getPageObjects }) { hash: `${config.get('apps.context.hash')}/${indexPattern}/${anchorType}/${anchorId}?_a=${initialState}`, }); + log.debug(`browser.get(${appUrl})`); + await browser.get(appUrl); await PageObjects.header.awaitGlobalLoadingIndicatorHidden(); await this.waitUntilContextLoadingHasFinished(); @@ -91,8 +93,8 @@ export function ContextPageProvider({ getService, getPageObjects }) { return await retry.try(async () => { const successorLoadMoreButton = await this.getSuccessorLoadMoreButton(); const predecessorLoadMoreButton = await this.getPredecessorLoadMoreButton(); - if (!(successorLoadMoreButton.isEnabled() && successorLoadMoreButton.isDisplayed() && - predecessorLoadMoreButton.isEnabled() && predecessorLoadMoreButton.isDisplayed())) { + if (!(await successorLoadMoreButton.isEnabled() && await successorLoadMoreButton.isDisplayed() && + await predecessorLoadMoreButton.isEnabled() && await predecessorLoadMoreButton.isDisplayed())) { throw new Error('loading context rows'); } }); diff --git a/x-pack/index.js b/x-pack/index.js index a395129d0880d..148f624a09220 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -35,6 +35,7 @@ import { remoteClusters } from './plugins/remote_clusters'; import { crossClusterReplication } from './plugins/cross_cluster_replication'; import { upgradeAssistant } from './plugins/upgrade_assistant'; import { uptime } from './plugins/uptime'; +import { ossTelemetry } from './plugins/oss_telemetry'; module.exports = function (kibana) { return [ @@ -69,5 +70,6 @@ module.exports = function (kibana) { crossClusterReplication(kibana), upgradeAssistant(kibana), uptime(kibana), + ossTelemetry(kibana), ]; }; diff --git a/x-pack/package.json b/x-pack/package.json index e375853a51777..79ead4b403719 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -132,6 +132,7 @@ "@scant/router": "^0.1.0", "@slack/client": "^4.8.0", "@turf/boolean-contains": "6.0.1", + "@types/json-stable-stringify": "^1.0.32", "angular-resource": "1.4.9", "angular-sanitize": "1.6.5", "angular-ui-ace": "0.2.3", @@ -187,6 +188,7 @@ "io-ts": "^1.4.2", "joi": "^13.5.2", "jquery": "^3.3.1", + "json-stable-stringify": "^1.0.1", "jsonwebtoken": "^8.3.0", "lodash": "npm:@elastic/lodash@3.10.1-kibana1", "lodash.keyby": "^4.6.0", diff --git a/x-pack/plugins/__mocks__/ui/chrome.js b/x-pack/plugins/__mocks__/ui/chrome.js index 38f31a42a51d0..e56124bede6e1 100644 --- a/x-pack/plugins/__mocks__/ui/chrome.js +++ b/x-pack/plugins/__mocks__/ui/chrome.js @@ -36,8 +36,13 @@ function getInjected(key) { } } +function getXsrfToken() { + return 'kbn'; +} + export default { getInjected, addBasePath, - getUiSettingsClient + getUiSettingsClient, + getXsrfToken }; diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx index 59f9beea80b8d..d7c4b5fa53f5e 100644 --- a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx +++ b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx @@ -26,7 +26,7 @@ describe('ErrorGroupOverview -> List', () => { const storeState = {}; const wrapper = mount( - + , storeState ); diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap index 7562a665efbb2..788450dbc2a85 100644 --- a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap @@ -531,7 +531,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > a0ce2 @@ -556,7 +556,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -623,7 +623,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > f3ac9 @@ -648,7 +648,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -715,7 +715,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > e9086 @@ -740,7 +740,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -807,7 +807,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > 8673d @@ -832,7 +832,7 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json index 3144ea3a80cd3..af6eea6306d8a 100644 --- a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json +++ b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json @@ -1,4 +1,5 @@ { + "location": {}, "urlParams": { "page": 0, "serviceName": "opbeans-python", @@ -35,5 +36,8 @@ "groupId": "8673d8bf7a032e387c101bafbab0d2bc", "latestOccurrenceAt": "2018-01-10T10:06:13.211Z" } - ] + ], + "location": { + "search": "?transactionId=abcdef0123456789" + } } diff --git a/x-pack/plugins/apm/public/components/app/Main/Home.tsx b/x-pack/plugins/apm/public/components/app/Main/Home.tsx index a047beb575324..843449bf197a8 100644 --- a/x-pack/plugins/apm/public/components/app/Main/Home.tsx +++ b/x-pack/plugins/apm/public/components/app/Main/Home.tsx @@ -13,7 +13,7 @@ import { } from 'x-pack/plugins/apm/public/components/shared/HistoryTabs'; // @ts-ignore import { KueryBar } from '../../shared/KueryBar'; -import { SetupInstructionsLink } from '../../shared/SetupInstructionsLink'; +import { SetupInstructionsLink } from '../../shared/Links/SetupInstructionsLink'; import { ServiceOverview } from '../ServiceOverview'; import { TraceOverview } from '../TraceOverview'; diff --git a/x-pack/plugins/apm/public/components/app/ServiceOverview/view.tsx b/x-pack/plugins/apm/public/components/app/ServiceOverview/view.tsx index 8e4f04d46f063..976eb29e0f6e3 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceOverview/view.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceOverview/view.tsx @@ -12,7 +12,7 @@ import { IServiceListItem } from 'x-pack/plugins/apm/server/lib/services/get_ser import { loadAgentStatus } from '../../../services/rest/apm/status_check'; import { ServiceListRequest } from '../../../store/reactReduxRequest/serviceList'; import { EmptyMessage } from '../../shared/EmptyMessage'; -import { SetupInstructionsLink } from '../../shared/SetupInstructionsLink'; +import { SetupInstructionsLink } from '../../shared/Links/SetupInstructionsLink'; import { ServiceList } from './ServiceList'; interface Props { diff --git a/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx b/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx index 64fd04105735d..6fe0b8cae6dab 100644 --- a/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx +++ b/x-pack/plugins/apm/public/components/app/TraceOverview/TraceList.tsx @@ -12,8 +12,8 @@ import { ITransactionGroup } from 'x-pack/plugins/apm/server/lib/transaction_gro import { fontSizes, truncate } from '../../../style/variables'; import { asMillis } from '../../../utils/formatters'; import { ImpactBar } from '../../shared/ImpactBar'; +import { TransactionLink } from '../../shared/Links/TransactionLink'; import { ITableColumn, ManagedTable } from '../../shared/ManagedTable'; -import { TransactionLink } from '../../shared/TransactionLink'; const StyledTransactionLink = styled(TransactionLink)` font-size: ${fontSizes.large}; diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/StickyTransactionProperties.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/StickyTransactionProperties.tsx index 5364d794c7ea4..8bfced3f83806 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/StickyTransactionProperties.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/StickyTransactionProperties.tsx @@ -8,6 +8,8 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { NOT_AVAILABLE_LABEL } from 'x-pack/plugins/apm/common/i18n'; import { idx } from 'x-pack/plugins/apm/common/idx'; +import { KibanaLink } from 'x-pack/plugins/apm/public/components/shared/Links/KibanaLink'; +import { legacyEncodeURIComponent } from 'x-pack/plugins/apm/public/components/shared/Links/url_helpers'; import { TRANSACTION_DURATION, TRANSACTION_RESULT, @@ -24,11 +26,13 @@ import { interface Props { transaction: Transaction; totalDuration?: number; + errorCount?: number; } export function StickyTransactionProperties({ transaction, - totalDuration + totalDuration, + errorCount }: Props) { const timestamp = transaction['@timestamp']; const url = @@ -90,5 +94,43 @@ export function StickyTransactionProperties({ } ]; + if (errorCount !== undefined) { + const errorsOverviewLink = ( + _.service.name)}/errors`} + query={{ + kuery: legacyEncodeURIComponent( + `transaction.id : "${transaction.transaction.id}"` + ) + }} + > + {i18n.translate('xpack.apm.transactionDetails.errorsOverviewLink', { + values: { errorCount }, + defaultMessage: + '{errorCount, plural, one {View 1 error} other {View # errors}}' + })} + + ); + + const noErrorsText = i18n.translate( + 'xpack.apm.transactionDetails.errorsNone', + { + defaultMessage: 'None' + } + ); + + stickyProperties.push({ + label: i18n.translate( + 'xpack.apm.transactionDetails.errorsOverviewLabel', + { + defaultMessage: 'Errors' + } + ), + val: errorCount === 0 ? noErrorsText : errorsOverviewLink, + width: '25%' + }); + } + return ; } diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/FlyoutTopLevelProperties.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/FlyoutTopLevelProperties.tsx index 8bde28f2fef16..e45d207254141 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/FlyoutTopLevelProperties.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/FlyoutTopLevelProperties.tsx @@ -11,8 +11,8 @@ import { TRANSACTION_NAME } from 'x-pack/plugins/apm/common/constants'; import { KibanaLink } from 'x-pack/plugins/apm/public/components/shared/Links/KibanaLink'; +import { TransactionLink } from 'x-pack/plugins/apm/public/components/shared/Links/TransactionLink'; import { StickyProperties } from 'x-pack/plugins/apm/public/components/shared/StickyProperties'; -import { TransactionLink } from 'x-pack/plugins/apm/public/components/shared/TransactionLink'; import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction'; interface Props { diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/StickySpanProperties.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/StickySpanProperties.tsx index ee593aee5f88b..9c2f03dd888ed 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/StickySpanProperties.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/StickySpanProperties.tsx @@ -73,7 +73,7 @@ export function StickySpanProperties({ span, totalDuration }: Props) { ), val: spanTypeLabel, truncated: true, - widht: '50%' + width: '50%' }, { fieldName: SPAN_DURATION, diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/index.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/index.tsx index 50a8d369ac74d..4681ad6e8d6f3 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/index.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/index.tsx @@ -18,8 +18,8 @@ import { Location } from 'history'; import React from 'react'; import { Transaction as ITransaction } from '../../../../../typings/es_schemas/Transaction'; import { IUrlParams } from '../../../../store/urlParams'; +import { TransactionLink } from '../../../shared/Links/TransactionLink'; import { TransactionActionMenu } from '../../../shared/TransactionActionMenu/TransactionActionMenu'; -import { TransactionLink } from '../../../shared/TransactionLink'; import { StickyTransactionProperties } from './StickyTransactionProperties'; import { TransactionPropertiesTable } from './TransactionPropertiesTable'; import { IWaterfall } from './WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers'; @@ -97,13 +97,15 @@ interface Props { urlParams: IUrlParams; location: Location; waterfall: IWaterfall; + errorCount?: number; } export const Transaction: React.SFC = ({ transaction, urlParams, location, - waterfall + waterfall, + errorCount }) => { return ( @@ -140,6 +142,7 @@ export const Transaction: React.SFC = ({ diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/view.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/view.tsx index f85a4f73d99d0..c7eb7f6ceb0b1 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/view.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/view.tsx @@ -8,6 +8,7 @@ import { EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { Location } from 'history'; import React from 'react'; +import { idx } from 'x-pack/plugins/apm/common/idx'; import { TransactionDetailsRequest } from '../../../store/reactReduxRequest/transactionDetails'; import { TransactionDetailsChartsRequest } from '../../../store/reactReduxRequest/transactionDetailsCharts'; import { TransactionDistributionRequest } from '../../../store/reactReduxRequest/transactionDistribution'; @@ -67,7 +68,10 @@ export function TransactionDetailsView({ urlParams, location }: Props) { { + render={({ data }) => { + const transaction = idx(data, _ => _.transaction); + const errorCount = idx(data, _ => _.errorCount); + if (!transaction) { return ( ); }} diff --git a/x-pack/plugins/apm/public/components/shared/KueryBar/view.js b/x-pack/plugins/apm/public/components/shared/KueryBar/view.js index ec67389dea90b..a2592968b4a68 100644 --- a/x-pack/plugins/apm/public/components/shared/KueryBar/view.js +++ b/x-pack/plugins/apm/public/components/shared/KueryBar/view.js @@ -59,7 +59,9 @@ class KueryBarView extends Component { selectionStart, indexPattern, boolFilter - )).filter(suggestion => !startsWith(suggestion.text, 'span.')); + )) + .filter(suggestion => !startsWith(suggestion.text, 'span.')) + .slice(0, 15); if (currentRequest !== this.currentRequest) { return; diff --git a/x-pack/plugins/apm/public/components/shared/Links/KibanaLink.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/KibanaLink.test.tsx index 0d182fe918260..d2ae0a7d0d3a6 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/KibanaLink.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/KibanaLink.test.tsx @@ -7,112 +7,20 @@ import { shallow } from 'enzyme'; import { Location } from 'history'; import React from 'react'; -import url from 'url'; import { UnconnectedKibanaLink } from './KibanaLink'; -function getUnconnectedKibanLink() { - const discoverQuery = { - _a: { - interval: 'auto', - query: { - language: 'lucene', - query: `context.service.name:"myServiceName" AND error.grouping_key:"myGroupId"` - }, - sort: { '@timestamp': 'desc' } - } - }; - - return shallow( - - Go to Discover - - ); -} - describe('UnconnectedKibanaLink', () => { - it('should have correct url', () => { - const wrapper = getUnconnectedKibanLink(); - const href = wrapper.find('EuiLink').prop('href') || ''; - const { _g, _a } = getUrlQuery(href); - const { pathname } = url.parse(href); - - expect(pathname).toBe('/app/kibana'); - expect(_a).toBe( - '(interval:auto,query:(language:lucene,query:\'context.service.name:"myServiceName" AND error.grouping_key:"myGroupId"\'),sort:(\'@timestamp\':desc))' - ); - expect(_g).toBe('(time:(from:now-24h,mode:quick,to:now))'); - }); - it('should render correct markup', () => { - const wrapper = getUnconnectedKibanLink(); - expect(wrapper).toMatchSnapshot(); - }); - - it('should include existing _g values in link href', () => { - const wrapper = getUnconnectedKibanLink(); - wrapper.setProps({ - location: { - search: - '?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-7d,mode:relative,to:now-1d))' - } - }); - const href = wrapper.find('EuiLink').prop('href'); - const { _g } = getUrlQuery(href); - - expect(_g).toBe( - '(refreshInterval:(pause:!t,value:0),time:(from:now-7d,mode:relative,to:now-1d))' - ); - }); - - it('should not throw due to hashed args', () => { - const wrapper = getUnconnectedKibanLink(); - expect(() => { - wrapper.setProps({ location: { search: '?_g=H@whatever' } }); - }).not.toThrow(); - }); - - it('should use default time range when _g is empty', () => { - const wrapper = getUnconnectedKibanLink(); - wrapper.setProps({ location: { search: '?_g=()' } }); - const href = wrapper.find('EuiLink').prop('href') as string; - const { _g } = getUrlQuery(href); - expect(_g).toBe('(time:(from:now-24h,mode:quick,to:now))'); - }); - - it('should merge in _g query values', () => { - const discoverQuery = { - _g: { - ml: { - jobIds: [1337] - } - } - }; - const wrapper = shallow( Go to Discover ); - const href = wrapper.find('EuiLink').prop('href') as string; - const { _g } = getUrlQuery(href); - expect(_g).toBe( - '(ml:(jobIds:!(1337)),time:(from:now-24h,mode:quick,to:now))' - ); + expect(wrapper).toMatchSnapshot(); }); }); - -function getUrlQuery(href?: string) { - const hash = url.parse(href!).hash!.slice(1); - return url.parse(hash, true).query; -} diff --git a/x-pack/plugins/apm/public/components/shared/Links/MLJobLink.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/MLJobLink.test.tsx index 473f2f4868fbe..67f41f77e4671 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/MLJobLink.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/MLJobLink.test.tsx @@ -34,7 +34,7 @@ describe('MLJobLink', () => { ); expect(wrapper.prop('href')).toBe( - '/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(myServiceName-myTransactionType-high_mean_response_time)),time:(from:now-24h,mode:quick,to:now))&_a=' + '/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(myServiceName-myTransactionType-high_mean_response_time)),time:(from:now-24h,mode:quick,to:now))' ); }); }); diff --git a/x-pack/plugins/apm/public/components/shared/SetupInstructionsLink.tsx b/x-pack/plugins/apm/public/components/shared/Links/SetupInstructionsLink.tsx similarity index 93% rename from x-pack/plugins/apm/public/components/shared/SetupInstructionsLink.tsx rename to x-pack/plugins/apm/public/components/shared/Links/SetupInstructionsLink.tsx index 43d50f7bc1ea9..a4f4c7c8c1242 100644 --- a/x-pack/plugins/apm/public/components/shared/SetupInstructionsLink.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/SetupInstructionsLink.tsx @@ -7,7 +7,7 @@ import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { KibanaLink } from './Links/KibanaLink'; +import { KibanaLink } from './KibanaLink'; export function SetupInstructionsLink({ buttonFill = false diff --git a/x-pack/plugins/apm/public/components/shared/TransactionLink.tsx b/x-pack/plugins/apm/public/components/shared/Links/TransactionLink.tsx similarity index 87% rename from x-pack/plugins/apm/public/components/shared/TransactionLink.tsx rename to x-pack/plugins/apm/public/components/shared/Links/TransactionLink.tsx index 12b9b52cd5a86..531b9668f6ca0 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionLink.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/TransactionLink.tsx @@ -5,9 +5,9 @@ */ import React from 'react'; -import { Transaction } from '../../../typings/es_schemas/Transaction'; -import { KibanaLink } from './Links/KibanaLink'; -import { legacyEncodeURIComponent } from './Links/url_helpers'; +import { Transaction } from '../../../../typings/es_schemas/Transaction'; +import { KibanaLink } from './KibanaLink'; +import { legacyEncodeURIComponent } from './url_helpers'; interface TransactionLinkProps { transaction?: Transaction; diff --git a/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/KibanaLink.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/KibanaLink.test.tsx.snap index 177a1c4e4a764..3626664a597a7 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/KibanaLink.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/KibanaLink.test.tsx.snap @@ -3,7 +3,7 @@ exports[`UnconnectedKibanaLink should render correct markup 1`] = ` Go to Discover diff --git a/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/MLJobLink.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/MLJobLink.test.tsx.snap index 52d59b1c4d963..8978c438c9ed0 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/MLJobLink.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/Links/__snapshots__/MLJobLink.test.tsx.snap @@ -3,7 +3,7 @@ exports[`MLJobLink should render component 1`] = ` `; diff --git a/x-pack/plugins/apm/public/components/shared/Links/url_helpers.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/url_helpers.test.tsx index 5ad674ca6efbf..808770938b61c 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/url_helpers.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/url_helpers.test.tsx @@ -42,35 +42,110 @@ describe('fromQuery', () => { }); describe('getKibanaHref', () => { - it('should return the correct href', () => { - const href = getKibanaHref({ - location: { search: '' } as Location, - pathname: '/app/kibana', - hash: '/discover', - query: { - _a: { - interval: 'auto', - query: { - language: 'lucene', - query: `context.service.name:"myServiceName" AND error.grouping_key:"myGroupId"` - }, - sort: { '@timestamp': 'desc' } - } + it('should build correct url', () => { + const location = {} as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const href = getKibanaHref({ location, pathname, hash }); + expect(href).toBe( + '/app/kibana#/discover?_g=(time:(from:now-24h,mode:quick,to:now))' + ); + }); + + it('should rison encode _a', () => { + const location = {} as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const query = { + _a: { + interval: 'auto', + query: { + language: 'lucene', + query: `context.service.name:"myServiceName" AND error.grouping_key:"myGroupId"` + }, + sort: { '@timestamp': 'desc' } } + }; + const href = getKibanaHref({ query, location, pathname, hash }); + const { _a } = getUrlQuery(href); + expect(_a).toEqual( + `(interval:auto,query:(language:lucene,query:'context.service.name:\"myServiceName\" AND error.grouping_key:\"myGroupId\"'),sort:('@timestamp':desc))` + ); + }); + + describe('_g', () => { + it('should preserve _g from location', () => { + const location = { + search: '?_g=(time:(from:now-7d,mode:relative,to:now-1d))' + } as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const href = getKibanaHref({ location, pathname, hash }); + const { _g } = getUrlQuery(href); + expect(_g).toBe('(time:(from:now-7d,mode:relative,to:now-1d))'); }); - const { _g, _a } = getUrlQuery(href); - const { pathname } = url.parse(href); + it('should use default time range when _g is empty', () => { + const location = {} as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const href = getKibanaHref({ location, pathname, hash }); + const { _g } = getUrlQuery(href); + expect(_g).toBe('(time:(from:now-24h,mode:quick,to:now))'); + }); - expect(pathname).toBe('/app/kibana'); - expect(_a).toBe( - '(interval:auto,query:(language:lucene,query:\'context.service.name:"myServiceName" AND error.grouping_key:"myGroupId"\'),sort:(\'@timestamp\':desc))' - ); - expect(_g).toBe('(time:(from:now-24h,mode:quick,to:now))'); + it('should use default value when given invalid input', () => { + const location = { search: '?_g=H@whatever' } as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const href = getKibanaHref({ location, pathname, hash }); + const { _g } = getUrlQuery(href); + expect(_g).toBe('(time:(from:now-24h,mode:quick,to:now))'); + }); + + it('should merge in _g query values', () => { + const location = { + search: '?_g=(time:(from:now-7d,mode:relative,to:now-1d))' + } as Location; + const pathname = '/app/kibana'; + const hash = '/discover'; + const query = { _g: { ml: { jobIds: [1337] } } }; + const href = getKibanaHref({ location, query, pathname, hash }); + const { _g } = getUrlQuery(href); + expect(_g).toBe( + '(ml:(jobIds:!(1337)),time:(from:now-7d,mode:relative,to:now-1d))' + ); + }); + }); + + describe('when location contains kuery', () => { + const location = { + search: '?kuery=transaction.duration.us~20~3E~201' + } as Location; + + it('should preserve kql for apm links', () => { + const pathname = '/app/apm'; + const href = getKibanaHref({ location, pathname }); + const { kuery } = getUrlQuery(href); + expect(kuery).toEqual('transaction.duration.us~20~3E~201'); + }); + + it('should preserve kql for links without path', () => { + const href = getKibanaHref({ location }); + const { kuery } = getUrlQuery(href); + expect(kuery).toEqual('transaction.duration.us~20~3E~201'); + }); + + it('should not preserve kql for non-apm links', () => { + const pathname = '/app/kibana'; + const href = getKibanaHref({ location, pathname }); + const { kuery } = getUrlQuery(href); + expect(kuery).toEqual(undefined); + }); }); }); -function getUrlQuery(href?: string) { - const hash = url.parse(href!).hash!.slice(1); +function getUrlQuery(href: string) { + const hash = url.parse(href).hash!.slice(1); return url.parse(hash, true).query; } diff --git a/x-pack/plugins/apm/public/components/shared/Links/url_helpers.ts b/x-pack/plugins/apm/public/components/shared/Links/url_helpers.ts index 762ed0c04825b..d73baf2129c23 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/url_helpers.ts +++ b/x-pack/plugins/apm/public/components/shared/Links/url_helpers.ts @@ -60,7 +60,11 @@ const DEFAULT_KIBANA_TIME_RANGE = { } }; -function getQueryWithRisonParams(location: Location, query: RisonDecoded = {}) { +function getQueryWithRisonParams( + location: Location, + pathname: string, + query: RisonDecoded = {} +) { // Preserve current _g and _a const currentQuery = toQuery(location.search); const decodedG = risonSafeDecode(currentQuery._g); @@ -68,11 +72,22 @@ function getQueryWithRisonParams(location: Location, query: RisonDecoded = {}) { const encodedG = rison.encode(combinedG); const encodedA = query._a ? rison.encode(query._a) : ''; - return { + const nextQuery: StringMap = { ...query, - _g: encodedG, - _a: encodedA + _g: encodedG }; + + // Preserve kuery for apm links + const isApmLink = pathname.includes('app/apm') || pathname === ''; + if (currentQuery.kuery && isApmLink) { + nextQuery.kuery = currentQuery.kuery; + } + + if (encodedA) { + nextQuery._a = encodedA; + } + + return nextQuery; } export interface KibanaHrefArgs { @@ -88,7 +103,11 @@ export function getKibanaHref({ hash, query = {} }: KibanaHrefArgs): string { - const queryWithRisonParams = getQueryWithRisonParams(location, query); + const queryWithRisonParams = getQueryWithRisonParams( + location, + pathname, + query + ); const search = stringifyWithoutEncoding(queryWithRisonParams); const href = url.format({ pathname: chrome.addBasePath(pathname), diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap index 51687920de715..a0ee770a0898a 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap @@ -20,7 +20,7 @@ exports[`TransactionActionMenu component should render with data 1`] = ` items={ Array [ , , , , , { - if (this.state.isDrawing) { - this.setState({ isDrawing: false }); - } this.props.onMouseLeave(...args); }; @@ -89,7 +86,7 @@ export class InnerCustomPlot extends PureComponent { }); onMouseUp = () => { - if (this.state.selectionEnd !== null) { + if (this.state.isDrawing && this.state.selectionEnd !== null) { const [start, end] = [ this.state.selectionStart, this.state.selectionEnd @@ -107,6 +104,14 @@ export class InnerCustomPlot extends PureComponent { } }; + componentDidMount() { + document.body.addEventListener('mouseup', this.onMouseUp); + } + + componentWillUnmount() { + document.body.removeEventListener('mouseup', this.onMouseUp); + } + render() { const { series, truncateLegends, noHits, width } = this.props; @@ -163,7 +168,6 @@ export class InnerCustomPlot extends PureComponent { onHover={this.onHover} onMouseLeave={this.onMouseLeave} onMouseDown={this.onMouseDown} - onMouseUp={this.onMouseUp} /> { wrapper .find('.rv-voronoi__cell') .at(20) - .simulate('mouseOver') - .simulate('mouseUp'); + .simulate('mouseOver'); + document.body.dispatchEvent(new Event('mouseup')); }); it('should call onSelectionEnd', () => { @@ -265,8 +265,8 @@ describe('when response has data', () => { wrapper .find('.rv-voronoi__cell') .at(10) - .simulate('mouseOver') - .simulate('mouseUp'); + .simulate('mouseOver'); + document.body.dispatchEvent(new Event('mouseup')); }); it('should call onSelectionEnd', () => { diff --git a/x-pack/plugins/apm/public/services/rest/apm/transactions.ts b/x-pack/plugins/apm/public/services/rest/apm/transactions.ts index 7a3bec3435140..ac793f53496e6 100644 --- a/x-pack/plugins/apm/public/services/rest/apm/transactions.ts +++ b/x-pack/plugins/apm/public/services/rest/apm/transactions.ts @@ -5,7 +5,7 @@ */ import { KFetchError } from 'ui/kfetch/kfetch_error'; -import { TransactionAPIResponse } from 'x-pack/plugins/apm/server/lib/transactions/get_transaction'; +import { TransactionWithErrorCountAPIResponse } from 'x-pack/plugins/apm/server/lib/transactions/get_transaction'; import { IUrlParams } from '../../../store/urlParams'; import { callApi } from '../callApi'; import { getEncodedEsQuery } from './apm'; @@ -19,7 +19,7 @@ export async function loadTransaction({ kuery }: IUrlParams) { try { - const result = await callApi({ + const result = await callApi({ pathname: `/api/apm/services/${serviceName}/transactions/${transactionId}`, query: { traceId, diff --git a/x-pack/plugins/apm/public/store/reactReduxRequest/transactionDetails.tsx b/x-pack/plugins/apm/public/store/reactReduxRequest/transactionDetails.tsx index b3a493e041c5f..a3b440962eaba 100644 --- a/x-pack/plugins/apm/public/store/reactReduxRequest/transactionDetails.tsx +++ b/x-pack/plugins/apm/public/store/reactReduxRequest/transactionDetails.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { Request, RRRRender } from 'react-redux-request'; -import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction'; +import { TransactionWithErrorCountAPIResponse } from 'x-pack/plugins/apm/server/lib/transactions/get_transaction'; import { loadTransaction } from '../../services/rest/apm/transactions'; import { IReduxState } from '../rootReducer'; import { IUrlParams } from '../urlParams'; @@ -21,7 +21,7 @@ export function TransactionDetailsRequest({ render }: { urlParams: IUrlParams; - render: RRRRender; + render: RRRRender; }) { const { serviceName, start, end, transactionId, traceId, kuery } = urlParams; diff --git a/x-pack/plugins/apm/server/lib/errors/get_error_count.ts b/x-pack/plugins/apm/server/lib/errors/get_error_count.ts new file mode 100644 index 0000000000000..fe960e8f5d0c4 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/errors/get_error_count.ts @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { ESFilter } from 'elasticsearch'; +import { idx } from 'x-pack/plugins/apm/common/idx'; +import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/Error'; +import { + PROCESSOR_EVENT, + TRACE_ID, + TRANSACTION_ID +} from '../../../common/constants'; +import { Setup } from '../helpers/setup_request'; + +export async function getErrorCount( + transactionId: string, + traceId: string, + setup: Setup +): Promise { + const { start, end, esFilterQuery, client, config } = setup; + const filter: ESFilter[] = [ + { term: { [TRANSACTION_ID]: transactionId } }, + { term: { [TRACE_ID]: traceId } }, + { term: { [PROCESSOR_EVENT]: 'error' } }, + { + range: { + '@timestamp': { + gte: start, + lte: end, + format: 'epoch_millis' + } + } + } + ]; + + if (esFilterQuery) { + filter.push(esFilterQuery); + } + + const params = { + index: config.get('apm_oss.errorIndices'), + body: { + size: 0, + query: { + bool: { filter } + } + } + }; + const resp = await client('search', params); + return idx(resp, _ => _.hits.total) || 0; +} diff --git a/x-pack/plugins/apm/server/lib/errors/get_error_group.ts b/x-pack/plugins/apm/server/lib/errors/get_error_group.ts index 1ee1c585cc724..87e919918909c 100644 --- a/x-pack/plugins/apm/server/lib/errors/get_error_group.ts +++ b/x-pack/plugins/apm/server/lib/errors/get_error_group.ts @@ -74,7 +74,7 @@ export async function getErrorGroup({ const traceId = idx(error, _ => _.trace.id); let transaction; - if (transactionId) { + if (transactionId && traceId) { transaction = await getTransaction(transactionId, traceId, setup); } diff --git a/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts index 6aef498b1acc8..d4f3ac9530712 100644 --- a/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_transaction/index.ts @@ -12,13 +12,19 @@ import { TRACE_ID, TRANSACTION_ID } from '../../../../common/constants'; +import { getErrorCount } from '../../errors/get_error_count'; import { Setup } from '../../helpers/setup_request'; export type TransactionAPIResponse = Transaction | undefined; +export interface TransactionWithErrorCountAPIResponse { + transaction: TransactionAPIResponse; + errorCount: number; +} + export async function getTransaction( transactionId: string, - traceId: string | undefined, + traceId: string, setup: Setup ): Promise { const { start, end, esFilterQuery, client, config } = setup; @@ -26,6 +32,7 @@ export async function getTransaction( const filter: ESFilter[] = [ { term: { [PROCESSOR_EVENT]: 'transaction' } }, { term: { [TRANSACTION_ID]: transactionId } }, + { term: { [TRACE_ID]: traceId } }, { range: { '@timestamp': { @@ -41,10 +48,6 @@ export async function getTransaction( filter.push(esFilterQuery); } - if (traceId) { - filter.push({ term: { [TRACE_ID]: traceId } }); - } - const params = { index: config.get('apm_oss.transactionIndices'), body: { @@ -60,3 +63,14 @@ export async function getTransaction( const resp = await client('search', params); return idx(resp, _ => _.hits.hits[0]._source); } + +export async function getTransactionWithErrorCount( + transactionId: string, + traceId: string, + setup: Setup +): Promise { + return Promise.all([ + getTransaction(transactionId, traceId, setup), + getErrorCount(transactionId, traceId, setup) + ]).then(([transaction, errorCount]) => ({ transaction, errorCount })); +} diff --git a/x-pack/plugins/apm/server/routes/transactions.ts b/x-pack/plugins/apm/server/routes/transactions.ts index faf95183132c5..2468accb0837c 100644 --- a/x-pack/plugins/apm/server/routes/transactions.ts +++ b/x-pack/plugins/apm/server/routes/transactions.ts @@ -9,7 +9,7 @@ import { Server } from 'hapi'; import Joi from 'joi'; import { withDefaultValidators } from '../lib/helpers/input_validation'; import { setupRequest } from '../lib/helpers/setup_request'; -import { getTransaction } from '../lib/transactions/get_transaction'; +import { getTransactionWithErrorCount } from '../lib/transactions/get_transaction'; export function initTransactionsApi(server: Server) { server.route({ @@ -18,7 +18,7 @@ export function initTransactionsApi(server: Server) { options: { validate: { query: withDefaultValidators({ - traceId: Joi.string().allow('') // TODO: this should be a path param and made required by 7.0 + traceId: Joi.string().required() }) } }, @@ -26,9 +26,13 @@ export function initTransactionsApi(server: Server) { const { transactionId } = req.params; const { traceId } = req.query as { traceId: string }; const setup = setupRequest(req); - const transaction = await getTransaction(transactionId, traceId, setup); - if (transaction) { - return transaction; + const transactionWithErrorCount = await getTransactionWithErrorCount( + transactionId, + traceId, + setup + ); + if (transactionWithErrorCount.transaction) { + return transactionWithErrorCount; } else { throw Boom.notFound('Cannot find the requested page'); } diff --git a/x-pack/plugins/beats_management/common/config_block_validation.ts b/x-pack/plugins/beats_management/common/config_block_validation.ts new file mode 100644 index 0000000000000..bf531865ad003 --- /dev/null +++ b/x-pack/plugins/beats_management/common/config_block_validation.ts @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import * as t from 'io-ts'; +import { PathReporter } from 'io-ts/lib/PathReporter'; +import { configBlockSchemas } from './config_schemas'; +import { ConfigurationBlock, createConfigurationBlockInterface } from './domain_types'; + +export const validateConfigurationBlocks = (configurationBlocks: ConfigurationBlock[]) => { + const validationMap = { + isHosts: t.array(t.string), + isString: t.string, + isPeriod: t.string, + isPath: t.string, + isPaths: t.array(t.string), + isYaml: t.string, + }; + + for (const [index, block] of configurationBlocks.entries()) { + const blockSchema = configBlockSchemas.find(s => s.id === block.type); + if (!blockSchema) { + throw new Error( + `Invalid config type of ${block.type} used in 'configuration_blocks' at index ${index}` + ); + } + + const interfaceConfig = blockSchema.configs.reduce( + (props, config) => { + if (config.options) { + props[config.id] = t.union(config.options.map(opt => t.literal(opt.value))); + } else if (config.validation) { + props[config.id] = validationMap[config.validation]; + } + + return props; + }, + {} as t.Props + ); + + const runtimeInterface = createConfigurationBlockInterface( + t.literal(blockSchema.id), + t.interface(interfaceConfig) + ); + + const validationResults = runtimeInterface.decode(block); + + if (validationResults.isLeft()) { + throw new Error( + `configuration_blocks validation error, configuration_blocks at index ${index} is invalid. ${ + PathReporter.report(validationResults)[0] + }` + ); + } + } +}; diff --git a/x-pack/plugins/beats_management/common/config_schemas.ts b/x-pack/plugins/beats_management/common/config_schemas.ts new file mode 100644 index 0000000000000..499a9479d4e8d --- /dev/null +++ b/x-pack/plugins/beats_management/common/config_schemas.ts @@ -0,0 +1,382 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +// Note: importing this is a temp thing. This file will be replaced with JSON from Beats/ES at some point +import { ConfigBlockSchema } from './domain_types'; + +export const configBlockSchemas: ConfigBlockSchema[] = [ + { + id: 'filebeat.inputs', + name: 'Filebeat Input', + version: 6.7, + allowOtherConfigs: true, + configs: [ + { + id: 'paths', + ui: { + label: 'Paths', + labelId: 'filebeatInputConfig.paths.ui.label', + type: 'multi-input', + helpText: 'filebeatInputConfig.paths.ui.helpText', + helpTextId: 'filebeatInputConfig.paths.ui.helpText', + placeholder: `first/path/to/file.json second/path/to/otherfile.json`, + }, + validation: 'isPaths', + error: 'filebeatInputConfig.paths.error', + errorId: 'filebeatInputConfig.paths.error', + required: true, + }, + ], + }, + { + id: 'filebeat.modules', + name: 'Filebeat Modules', + version: 6.7, + allowOtherConfigs: true, + configs: [ + { + id: '_sub_type', + ui: { + label: 'filebeatModuleConfig.module.ui.label', + labelId: 'filebeatModuleConfig.module.ui.label', + type: 'select', + }, + options: [ + { + value: 'apache2', + text: 'apache2', + }, + { + value: 'auditd', + text: 'auditd', + }, + { + value: 'elasticsearch', + text: 'elasticsearch', + }, + { + value: 'haproxy', + text: 'haproxy', + }, + { + value: 'icinga', + text: 'icinga', + }, + { + value: 'iis', + text: 'iis', + }, + { + value: 'kafka', + text: 'kafka', + }, + { + value: 'kibana', + text: 'kibana', + }, + { + value: 'logstash', + text: 'logstash', + }, + { + value: 'mongodb', + text: 'mongodb', + }, + { + value: 'mysql', + text: 'mysql', + }, + { + value: 'nginx', + text: 'nginx', + }, + { + value: 'osquery', + text: 'osquery', + }, + { + value: 'postgresql', + text: 'postgresql', + }, + { + value: 'redis', + text: 'redis', + }, + { + value: 'system', + text: 'system', + }, + { + value: 'traefik', + text: 'traefik', + }, + ], + error: 'filebeatModuleConfig.module.error', + errorId: 'filebeatModuleConfig.module.error', + required: true, + }, + ], + }, + { + id: 'metricbeat.modules', + name: 'Metricbeat Modules', + version: 6.7, + allowOtherConfigs: true, + configs: [ + { + id: '_sub_type', + ui: { + label: 'metricbeatModuleConfig.module.ui.label', + labelId: 'metricbeatModuleConfig.module.ui.label', + type: 'select', + }, + options: [ + { + value: 'aerospike', + text: 'aerospike', + }, + { + value: 'apache', + text: 'apache', + }, + { + value: 'ceph', + text: 'ceph', + }, + { + value: 'couchbase', + text: 'couchbase', + }, + { + value: 'docker', + text: 'docker', + }, + { + value: 'dropwizard', + text: 'dropwizard', + }, + { + value: 'elasticsearch', + text: 'elasticsearch', + }, + { + value: 'envoyproxy', + text: 'envoyproxy', + }, + { + value: 'etcd', + text: 'etcd', + }, + { + value: 'golang', + text: 'golang', + }, + { + value: 'graphite', + text: 'graphite', + }, + { + value: 'haproxy', + text: 'haproxy', + }, + { + value: 'http', + text: 'http', + }, + { + value: 'jolokia', + text: 'jolokia', + }, + { + value: 'kafka', + text: 'kafka', + }, + { + value: 'kibana', + text: 'kibana', + }, + { + value: 'kubernetes', + text: 'kubernetes', + }, + { + value: 'kvm', + text: 'kvm', + }, + { + value: 'logstash', + text: 'logstash', + }, + { + value: 'memcached', + text: 'memcached', + }, + { + value: 'mongodb', + text: 'mongodb', + }, + { + value: 'munin', + text: 'munin', + }, + { + value: 'mysql', + text: 'mysql', + }, + { + value: 'nginx', + text: 'nginx', + }, + { + value: 'php_fpm', + text: 'php_fpm', + }, + { + value: 'postgresql', + text: 'postgresql', + }, + { + value: 'prometheus', + text: 'prometheus', + }, + { + value: 'rabbitmq', + text: 'rabbitmq', + }, + { + value: 'redis', + text: 'redis', + }, + { + value: 'system', + text: 'system', + }, + { + value: 'traefik', + text: 'traefik', + }, + { + value: 'uwsgi', + text: 'uwsgi', + }, + { + value: 'vsphere', + text: 'vsphere', + }, + { + value: 'windows', + text: 'windows', + }, + { + value: 'zookeeper', + text: 'zookeeper', + }, + ], + error: 'metricbeatModuleConfig.module.error', + errorId: 'metricbeatModuleConfig.module.error', + required: true, + }, + { + id: 'hosts', + ui: { + label: 'metricbeatModuleConfig.hosts.ui.label', + labelId: 'metricbeatModuleConfig.hosts.ui.label', + type: 'multi-input', + helpText: 'metricbeatModuleConfig.hosts.ui.helpText', + helpTextId: 'metricbeatModuleConfig.hosts.ui.helpText', + placeholder: `somehost.local otherhost.local`, + }, + validation: 'isHosts', + error: 'metricbeatModuleConfig.hosts.error', + errorId: 'metricbeatModuleConfig.hosts.error', + required: false, + }, + { + id: 'period', + ui: { + label: 'metricbeatModuleConfig.period.ui.label', + labelId: 'metricbeatModuleConfig.period.ui.label', + type: 'input', + }, + defaultValue: '10s', + validation: 'isPeriod', + error: 'metricbeatModuleConfig.period.error', + errorId: 'metricbeatModuleConfig.period.error', + required: true, + }, + ], + }, + { + id: 'output', + name: 'Outputs', + allowOtherConfigs: true, + version: 6.7, + configs: [ + { + id: '_sub_type', + ui: { + label: 'outputConfig.output.ui.label', + labelId: 'outputConfig.output.ui.label', + type: 'select', + }, + options: [ + { + value: 'elasticsearch', + text: 'Elasticsearch', + }, + { + value: 'logstash', + text: 'Logstash', + }, + { + value: 'kafka', + text: 'Kafka', + }, + { + value: 'redis', + text: 'Redis', + }, + ], + error: 'outputConfig.output.error', + errorId: 'outputConfig.output.error', + required: true, + }, + { + id: 'hosts', + ui: { + label: 'outputConfig.hosts.ui.label', + labelId: 'outputConfig.hosts.ui.label', + type: 'multi-input', + }, + validation: 'isHosts', + error: 'outputConfig.hosts.error', + errorId: 'outputConfig.hosts.error', + parseValidResult: v => v.split('\n'), + }, + { + id: 'username', + ui: { + label: 'outputConfig.username.ui.label', + labelId: 'outputConfig.username.ui.label', + type: 'input', + }, + validation: 'isString', + error: 'outputConfig.username.error', + errorId: 'outputConfig.username.error', + }, + { + id: 'password', + ui: { + label: 'outputConfig.password.ui.label', + labelId: 'outputConfig.password.ui.label', + type: 'password', + }, + validation: 'isString', + error: 'outputConfig.password.error', + errorId: 'outputConfig.password.error', + }, + ], + }, +]; diff --git a/x-pack/plugins/beats_management/public/config_schemas_translations_map.ts b/x-pack/plugins/beats_management/common/config_schemas_translations_map.ts similarity index 86% rename from x-pack/plugins/beats_management/public/config_schemas_translations_map.ts rename to x-pack/plugins/beats_management/common/config_schemas_translations_map.ts index faec5a32d86d4..6e08e32ded166 100644 --- a/x-pack/plugins/beats_management/public/config_schemas_translations_map.ts +++ b/x-pack/plugins/beats_management/common/config_schemas_translations_map.ts @@ -5,18 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { cloneDeep } from 'lodash'; -import { supportedConfigs } from './config_schemas'; -import { YamlConfigSchema } from './lib/types'; +import { ConfigBlockSchema } from './domain_types'; -interface ConfigSchema { - text: string; - value: string; - config: YamlConfigSchema[]; -} - -let translatedConfigs: ConfigSchema[]; -const supportedConfigLabelsMap = new Map([ +export const supportedConfigLabelsMap = new Map([ [ 'filebeatInputConfig.paths.ui.label', i18n.translate('xpack.beatsManagement.filebeatInputConfig.pathsLabel', { @@ -195,13 +186,13 @@ const supportedConfigLabelsMap = new Map([ ], [ - 'supportedConfigs.filebeatInput.text', + 'supportedConfigs.filebeat.input.text', i18n.translate('xpack.beatsManagement.tagConfig.filebeatInputLabel', { defaultMessage: 'Filebeat Input', }), ], [ - 'supportedConfigs.filebeatModule.text', + 'supportedConfigs.filebeat.modules.text', i18n.translate('xpack.beatsManagement.tagConfig.filebeatModuleLabel', { defaultMessage: 'Filebeat Module', }), @@ -220,28 +211,31 @@ const supportedConfigLabelsMap = new Map([ ], ]); -export const getSupportedConfig = () => { +export let translatedConfigs: ConfigBlockSchema[]; +export const translateConfigSchema = (schemas: ConfigBlockSchema[]) => { if (translatedConfigs) { return translatedConfigs; } - translatedConfigs = cloneDeep(supportedConfigs); - translatedConfigs.forEach(({ text, config }, index) => { - if (text) { - translatedConfigs[index].text = supportedConfigLabelsMap.get(text) || ''; - } + translatedConfigs = schemas.map(schema => { + schema.name = supportedConfigLabelsMap.get(`supportedConfigs.${schema.id}.text`) || schema.name; - config.forEach(yanlConfig => { - if (yanlConfig.ui.label) { - yanlConfig.ui.label = supportedConfigLabelsMap.get(yanlConfig.ui.label) || ''; + schema.configs = schema.configs.map(configBlock => { + if (configBlock.ui.label) { + configBlock.ui.label = + supportedConfigLabelsMap.get(configBlock.ui.labelId || '') || configBlock.ui.label; } - if (yanlConfig.ui.helpText) { - yanlConfig.ui.helpText = supportedConfigLabelsMap.get(yanlConfig.ui.helpText); + if (configBlock.ui.helpText) { + configBlock.ui.helpText = + supportedConfigLabelsMap.get(configBlock.ui.helpTextId || '') || configBlock.ui.helpText; } - if (yanlConfig.error) { - yanlConfig.error = supportedConfigLabelsMap.get(yanlConfig.error) || ''; + if (configBlock.error) { + configBlock.error = + supportedConfigLabelsMap.get(configBlock.errorId || '') || configBlock.error; } + return configBlock; }); + return schema; }); return translatedConfigs; diff --git a/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts b/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts index e89e53e25b89d..33872bce2cbb8 100644 --- a/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts +++ b/x-pack/plugins/beats_management/common/constants/configuration_blocks.ts @@ -4,12 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export enum ConfigurationBlockTypes { - FilebeatInputs = 'filebeat.inputs', - FilebeatModules = 'filebeat.modules', - MetricbeatModules = 'metricbeat.modules', - Output = 'output', - Processors = 'processors', -} - -export const UNIQUENESS_ENFORCING_TYPES = [ConfigurationBlockTypes.Output]; +export const UNIQUENESS_ENFORCING_TYPES = ['output']; diff --git a/x-pack/plugins/beats_management/common/constants/index.ts b/x-pack/plugins/beats_management/common/constants/index.ts index e111d32d41802..31fa84906cd38 100644 --- a/x-pack/plugins/beats_management/common/constants/index.ts +++ b/x-pack/plugins/beats_management/common/constants/index.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -export { PLUGIN } from './plugin'; +export { UNIQUENESS_ENFORCING_TYPES } from './configuration_blocks'; export { INDEX_NAMES } from './index_names'; -export { UNIQUENESS_ENFORCING_TYPES, ConfigurationBlockTypes } from './configuration_blocks'; -export const BASE_PATH = '/management/beats_management'; +export { PLUGIN } from './plugin'; +export { LICENSES, REQUIRED_LICENSES, REQUIRED_ROLES } from './security'; export { TABLE_CONFIG } from './table'; -export { REQUIRED_ROLES, LICENSES, REQUIRED_LICENSES } from './security'; +export const BASE_PATH = '/management/beats_management'; diff --git a/x-pack/plugins/beats_management/common/domain_types.ts b/x-pack/plugins/beats_management/common/domain_types.ts index 5621a313a2a38..858e25ff5f562 100644 --- a/x-pack/plugins/beats_management/common/domain_types.ts +++ b/x-pack/plugins/beats_management/common/domain_types.ts @@ -3,59 +3,38 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { ConfigurationBlockTypes } from './constants'; +import * as t from 'io-ts'; +import { configBlockSchemas } from './config_schemas'; -export enum FilebeatModuleName { - system = 'system', - apache2 = 'apache2', - nginx = 'nginx', - mongodb = 'mongodb', - elasticsearch = 'elasticsearch', -} - -export enum MetricbeatModuleName { - system = 'system', - apache2 = 'apache2', - nginx = 'nginx', - mongodb = 'mongodb', - elasticsearch = 'elasticsearch', -} - -export enum OutputType { - elasticsearch = 'elasticsearch', - logstash = 'logstash', - kafka = 'kafka', - redis = 'redis', -} - -// TODO convery above enum to an array dynamicly here export const OutputTypesArray = ['elasticsearch', 'logstash', 'kafka', 'redis']; -export interface FilebeatInputsConfig { - paths: string[]; - other: string; -} -export interface FilebeatModuleConfig { - module: FilebeatModuleName; - other: string; -} -export interface MetricbeatModuleConfig { - module: MetricbeatModuleName; - hosts?: string[]; - period: string; - other: string; -} - -export type ConfigContent = FilebeatInputsConfig | FilebeatModuleConfig | MetricbeatModuleConfig; -export interface ConfigurationBlock { - type: ConfigurationBlockTypes; - description: string; - configs: ConfigContent[]; -} - -export interface ReturnedConfigurationBlock - extends Pick> { - config: ConfigContent; +// Here we create the runtime check for a generic, unknown beat config type. +// We can also pass in optional params to create spacific runtime checks that +// can be used to validate blocs on the API and UI +export const createConfigurationBlockInterface = ( + configType: t.LiteralType | t.UnionType>> = t.union( + configBlockSchemas.map(s => t.literal(s.id)) + ), + beatConfigInterface: t.Mixed = t.Dictionary +) => + t.interface( + { + id: t.union([t.undefined, t.string]), + type: configType, + description: t.union([t.undefined, t.string]), + tag: t.string, + config: beatConfigInterface, + last_updated: t.union([t.undefined, t.number]), + }, + 'ConfigBlock' + ); +const BaseConfigurationBlock = createConfigurationBlockInterface(); +export interface ConfigurationBlock + extends Pick< + t.TypeOf, + Exclude, 'id'> + > { + id: string; } export interface CMBeat { @@ -73,19 +52,55 @@ export interface CMBeat { last_checkin?: Date; event_rate?: string; local_configuration_yml?: string; - tags?: string[]; + tags: string[]; central_configuration_yml?: string; metadata?: {}; name?: string; + last_updated: number; } -export interface CMPopulatedBeat extends CMBeat { - full_tags: BeatTag[]; +export interface ConfigBlockSchema { + id: string; + name: string; + version: number; + allowOtherConfigs?: boolean; + configs: BeatConfigSchema[]; +} + +export interface BeatConfigSchema { + id: string; + ui: { + label: string; + labelId?: string; + type: 'input' | 'multi-input' | 'select' | 'code' | 'password'; + helpText?: string; + helpTextId?: string; + placeholder?: string; + }; + options?: Array<{ value: string; text: string }>; + validation?: 'isHosts' | 'isString' | 'isPeriod' | 'isPath' | 'isPaths' | 'isYaml'; + error: string; + errorId: string; + defaultValue?: string; + required?: boolean; + parseValidResult?: (value: any) => any; } -export interface BeatTag { +export const RuntimeBeatTag = t.interface( + { + id: t.union([t.undefined, t.string]), + name: t.string, + color: t.string, + hasConfigurationBlocksTypes: t.array(t.string), + }, + 'CMBeat' +); +export interface BeatTag + extends Pick< + t.TypeOf, + Exclude, 'id'> + > { id: string; - configuration_blocks: ConfigurationBlock[]; - color?: string; - last_updated: Date; + // Used by the UI and api when a tag exists but is an invalid option + disabled?: boolean; } diff --git a/x-pack/plugins/beats_management/public/components/config_list.tsx b/x-pack/plugins/beats_management/public/components/config_list.tsx index a6e095c1d225d..ed5c925ef950b 100644 --- a/x-pack/plugins/beats_management/public/components/config_list.tsx +++ b/x-pack/plugins/beats_management/public/components/config_list.tsx @@ -8,18 +8,42 @@ import { EuiBasicTable, EuiLink } from '@elastic/eui'; import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import React from 'react'; +import { configBlockSchemas } from '../../common/config_schemas'; +import { translateConfigSchema } from '../../common/config_schemas_translations_map'; import { ConfigurationBlock } from '../../common/domain_types'; -import { getSupportedConfig } from '../config_schemas_translations_map'; interface ComponentProps { - configs: ConfigurationBlock[]; + configs: { + error?: string | undefined; + blocks: ConfigurationBlock[]; + page: number; + total: number; + }; onConfigClick: (action: 'edit' | 'delete', config: ConfigurationBlock) => any; + onTableChange: (index: number, size: number) => void; intl: InjectedIntl; } +const pagination = { + pageSize: 5, + hidePerPageOptions: true, +}; const ConfigListUi: React.SFC = props => ( { + if (props.onTableChange) { + props.onTableChange(table.page.index, table.page.size); + } + }} columns={[ { field: 'type', @@ -28,12 +52,14 @@ const ConfigListUi: React.SFC = props => ( defaultMessage: 'Type', }), truncateText: false, - render: (value: string, config: ConfigurationBlock) => { - const type = getSupportedConfig().find((sc: any) => sc.value === config.type); + render: (type: string, config: ConfigurationBlock) => { + const translatedConfig = translateConfigSchema(configBlockSchemas).find( + sc => sc.id === type + ); return ( props.onConfigClick('edit', config)}> - {type ? type.text : config.type} + {translatedConfig ? translatedConfig.name : type} ); }, @@ -45,9 +71,9 @@ const ConfigListUi: React.SFC = props => ( defaultMessage: 'Module', }), truncateText: false, - render: (value: string) => { + render: (value: string, config: ConfigurationBlock) => { return ( - value || + config.config._sub_type || props.intl.formatMessage({ id: 'xpack.beatsManagement.tagTable.moduleColumn.notAvailibaleLabel', defaultMessage: 'N/A', diff --git a/x-pack/plugins/beats_management/public/components/layouts/primary.tsx b/x-pack/plugins/beats_management/public/components/layouts/primary.tsx index bf192b3f1cc0c..ab03ff84fb364 100644 --- a/x-pack/plugins/beats_management/public/components/layouts/primary.tsx +++ b/x-pack/plugins/beats_management/public/components/layouts/primary.tsx @@ -16,7 +16,6 @@ import { EuiPageHeaderSection, EuiTitle, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import React, { Component, ReactNode } from 'react'; import styled from 'styled-components'; import { BreadcrumbConsumer } from '../navigation/breadcrumb'; @@ -42,23 +41,7 @@ export class PrimaryLayout extends Component { {({ breadcrumbs }) => ( - + )} diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx index 3e704ed8f246e..bd4e9dad25f9f 100644 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx +++ b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx @@ -11,7 +11,7 @@ import { Breadcrumb as BreadcrumbData, BreadcrumbContext } from './types'; interface BreadcrumbManagerProps extends RouteProps { text: string; - href: string; + href?: string; parents?: BreadcrumbData[]; context: BreadcrumbContext; } @@ -44,7 +44,7 @@ class BreadcrumbManager extends Component | Array>; } interface ComponentState { breadcrumbs: Array<{ - href: string; + href?: string; breadcrumb: Breadcrumb; parents?: Breadcrumb[]; }>; @@ -64,6 +66,9 @@ export class BreadcrumbProvider extends Component{this.props.children}; } } diff --git a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts index 9b9e8e3230d99..d1d4db8eb1409 100644 --- a/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts +++ b/x-pack/plugins/beats_management/public/components/navigation/breadcrumb/types.d.ts @@ -11,5 +11,5 @@ export interface BreadcrumbContext { } export interface Breadcrumb { text: string; - href: string; + href?: string; } diff --git a/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx b/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx index 1f683ca418912..cd75f882186c2 100644 --- a/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx +++ b/x-pack/plugins/beats_management/public/components/table/controls/tag_badge_list.tsx @@ -9,6 +9,7 @@ import { EuiContextMenuPanel, EuiFlexGroup, EuiFlexItem, + EuiLoadingSpinner, EuiPopover, } from '@elastic/eui'; import React from 'react'; @@ -17,7 +18,7 @@ import { TagBadge } from '../../tag/tag_badge'; import { AssignmentActionType } from '../index'; interface TagBadgeListProps { - items: any[]; + items: object[]; disabled: boolean; name: string; action?: AssignmentActionType; @@ -26,6 +27,7 @@ interface TagBadgeListProps { interface ComponentState { isPopoverOpen: boolean; + items: object[]; } export class TagBadgeList extends React.Component { @@ -34,6 +36,7 @@ export class TagBadgeList extends React.Component - {this.props.items.map((tag: any) => ( - + {!this.props.items && } + {this.props.items && this.props.items.length === 0 && ( + - - this.props.actionHandler(AssignmentActionType.Assign, tag.id)} - onClickAriaLabel={tag.id} - tag={tag} - /> - + No options avaliable - ))} + )} + {this.props.items && + this.props.items.map((tag: any) => ( + + + + + this.props.actionHandler(AssignmentActionType.Assign, tag.id) + } + onClickAriaLabel={tag.id} + tag={tag} + /> + + + + ))} ); } - private onButtonClick = () => { + private onButtonClick = async () => { + this.props.actionHandler(AssignmentActionType.Reload); this.setState(prevState => ({ isPopoverOpen: !prevState.isPopoverOpen, })); diff --git a/x-pack/plugins/beats_management/public/components/table/table.tsx b/x-pack/plugins/beats_management/public/components/table/table.tsx index 65abd406adcf1..cd6e871f97d9e 100644 --- a/x-pack/plugins/beats_management/public/components/table/table.tsx +++ b/x-pack/plugins/beats_management/public/components/table/table.tsx @@ -4,13 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - EuiFlexGroup, - EuiFlexItem, - // @ts-ignore - EuiInMemoryTable, - EuiSpacer, -} from '@elastic/eui'; +import { EuiBasicTable, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import styled from 'styled-components'; @@ -49,12 +43,14 @@ interface TableProps { hideTableControls?: boolean; kueryBarProps?: KueryBarProps; items: any[]; + onTableChange?: (index: number, size: number) => void; type: TableType; actionHandler?(action: AssignmentActionType, payload?: any): void; } interface TableState { selection: any[]; + pageIndex: number; } const TableContainer = styled.div` @@ -67,6 +63,7 @@ export class Table extends React.Component { this.state = { selection: [], + pageIndex: 0, }; } @@ -90,7 +87,8 @@ export class Table extends React.Component { const { actionData, actions, hideTableControls, items, kueryBarProps, type } = this.props; const pagination = { - initialPageSize: TABLE_CONFIG.INITIAL_ROW_SIZE, + pageIndex: this.state.pageIndex, + pageSize: TABLE_CONFIG.INITIAL_ROW_SIZE, pageSizeOptions: TABLE_CONFIG.PAGE_SIZE_OPTIONS, }; @@ -136,16 +134,26 @@ export class Table extends React.Component { )} - ); } + + private onTableChange = (page: { index: number; size: number } = { index: 0, size: 50 }) => { + if (this.props.onTableChange) { + this.props.onTableChange(page.index, page.size); + } + this.setState({ + pageIndex: page.index, + }); + }; } diff --git a/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx b/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx index e651b0ed210bb..b6e929ce1a473 100644 --- a/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx +++ b/x-pack/plugins/beats_management/public/components/table/table_type_configs.tsx @@ -6,10 +6,10 @@ import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiToolTip, IconColor } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { first, sortBy, sortByOrder, uniq } from 'lodash'; +import { sortBy, uniq } from 'lodash'; import moment from 'moment'; import React from 'react'; -import { BeatTag, CMPopulatedBeat, ConfigurationBlock } from '../../../common/domain_types'; +import { BeatTag, CMBeat } from '../../../common/domain_types'; import { ConnectedLink } from '../navigation/connected_link'; import { TagBadge } from '../tag'; @@ -60,7 +60,7 @@ export const BeatsTableType: TableType = { name: i18n.translate('xpack.beatsManagement.beatsTable.beatNameTitle', { defaultMessage: 'Beat name', }), - render: (name: string, beat: CMPopulatedBeat) => ( + render: (name: string, beat: CMBeat) => ( {name} ), sortable: true, @@ -77,9 +77,9 @@ export const BeatsTableType: TableType = { name: i18n.translate('xpack.beatsManagement.beatsTable.tagsTitle', { defaultMessage: 'Tags', }), - render: (value: string, beat: CMPopulatedBeat) => ( + render: (value: string, beat: CMBeat & { tags: BeatTag[] }) => ( - {(sortBy(beat.full_tags, 'id') || []).map(tag => ( + {(sortBy(beat.tags, 'id') || []).map(tag => ( @@ -95,7 +95,7 @@ export const BeatsTableType: TableType = { name: i18n.translate('xpack.beatsManagement.beatsTable.configStatusTitle', { defaultMessage: 'Config Status', }), - render: (value: string, beat: CMPopulatedBeat) => { + render: (value: string, beat: CMBeat) => { let color: IconColor = 'success'; let statusText = i18n.translate('xpack.beatsManagement.beatsTable.configStatus.okLabel', { defaultMessage: 'OK', @@ -159,19 +159,19 @@ export const BeatsTableType: TableType = { }, sortable: false, }, - { - field: 'full_tags', - name: i18n.translate('xpack.beatsManagement.beatsTable.lastConfigUpdateTitle', { - defaultMessage: 'Last config update', - }), - render: (tags?: BeatTag[]) => - tags && tags.length ? ( - - {moment(first(sortByOrder(tags, ['last_updated'], ['desc'])).last_updated).fromNow()} - - ) : null, - sortable: true, - }, + // { + // field: 'full_tags', + // name: i18n.translate('xpack.beatsManagement.beatsTable.lastConfigUpdateTitle', { + // defaultMessage: 'Last config update', + // }), + // render: (tags?: BeatTag[]) => + // tags && tags.length ? ( + // + // {moment(first(sortByOrder(tags, ['last_updated'], ['desc'])).last_updated).fromNow()} + // + // ) : null, + // sortable: true, + // }, ], controlDefinitions: (data: any[]) => ({ actions: [ @@ -212,17 +212,6 @@ export const TagsTableType: TableType = { sortable: true, width: '45%', }, - { - align: 'right', - field: 'configuration_blocks', - name: i18n.translate('xpack.beatsManagement.tagsTable.configurationsTitle', { - defaultMessage: 'Configurations', - }), - render: (configurationBlocks: ConfigurationBlock[]) => ( -
{configurationBlocks.length}
- ), - sortable: false, - }, { align: 'right', field: 'last_updated', @@ -263,15 +252,6 @@ export const BeatDetailTagsTable: TableType = { sortable: true, width: '55%', }, - { - align: 'right', - field: 'configuration_blocks', - name: i18n.translate('xpack.beatsManagement.beatTagsTable.configurationsTitle', { - defaultMessage: 'Configurations', - }), - render: (configurations: ConfigurationBlock[]) => {configurations.length}, - sortable: true, - }, { align: 'right', field: 'last_updated', diff --git a/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx b/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx index c1f557c82243c..27401271d4178 100644 --- a/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx +++ b/x-pack/plugins/beats_management/public/components/tag/config_view/config_form.tsx @@ -4,13 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ // @ts-ignore +import { i18n } from '@kbn/i18n'; import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; -import Formsy, { addValidationRule, FieldValue, FormData } from 'formsy-react'; -import yaml from 'js-yaml'; +import Formsy from 'formsy-react'; import { get } from 'lodash'; import React from 'react'; -import { ConfigurationBlock } from '../../../../common/domain_types'; -import { YamlConfigSchema } from '../../../lib/types'; +import { ConfigBlockSchema, ConfigurationBlock } from '../../../../common/domain_types'; import { FormsyEuiCodeEditor, FormsyEuiFieldText, @@ -19,52 +18,20 @@ import { FormsyEuiSelect, } from '../../inputs'; -addValidationRule('isHosts', (form: FormData, values: FieldValue | string[]) => { - // TODO add more validation - return true; -}); - -addValidationRule('isString', (values: FormData, value: FieldValue) => { - return true; -}); - -addValidationRule('isPeriod', (values: FormData, value: FieldValue) => { - // TODO add more validation - return true; -}); - -addValidationRule('isPath', (values: FormData, value: FieldValue) => { - // TODO add more validation - return value && value.length > 0; -}); - -addValidationRule('isPaths', (values: FormData, value: FieldValue) => { - // TODO add more validation - return true; -}); - -addValidationRule('isYaml', (values: FormData, value: FieldValue) => { - try { - const stuff = yaml.safeLoad(value || ''); - if (typeof stuff === 'string') { - return false; - } - return true; - } catch (e) { - return false; - } -}); - interface ComponentProps { intl: InjectedIntl; values: ConfigurationBlock; - schema: YamlConfigSchema[]; + schema: ConfigBlockSchema; id: string; onSubmit?: (modal: any) => any; canSubmit(canIt: boolean): any; } -class ConfigFormUi extends React.Component { +interface ComponentState { + canSubmit: boolean; +} + +class ConfigFormUi extends React.Component { private form = React.createRef(); constructor(props: ComponentProps) { super(props); @@ -108,7 +75,7 @@ class ConfigFormUi extends React.Component { onValid={this.enableButton} onInvalid={this.disableButton} > - {this.props.schema.map(schema => { + {this.props.schema.configs.map(schema => { switch (schema.ui.type) { case 'input': return ( @@ -117,7 +84,7 @@ class ConfigFormUi extends React.Component { id={schema.id} defaultValue={get( this.props, - `values.configs[0].${schema.id}`, + `values.config.${schema.id}`, schema.defaultValue )} name={schema.id} @@ -125,7 +92,6 @@ class ConfigFormUi extends React.Component { helpText={schema.ui.helpText} placeholder={schema.ui.placeholder} label={schema.ui.label} - validations={schema.validations} validationError={schema.error} required={schema.required || false} /> @@ -138,14 +104,13 @@ class ConfigFormUi extends React.Component { disabled={!this.props.onSubmit} defaultValue={get( this.props, - `values.configs[0].${schema.id}`, + `values.config.${schema.id}`, schema.defaultValue )} name={schema.id} placeholder={schema.ui.placeholder} helpText={schema.ui.helpText} label={schema.ui.label} - validations={schema.validations} validationError={schema.error} required={schema.required || false} /> @@ -158,14 +123,13 @@ class ConfigFormUi extends React.Component { disabled={!this.props.onSubmit} defaultValue={get( this.props, - `values.configs[0].${schema.id}`, + `values.config.${schema.id}`, schema.defaultValue )} name={schema.id} placeholder={schema.ui.placeholder} helpText={schema.ui.helpText} label={schema.ui.label} - validations={schema.validations} validationError={schema.error} required={schema.required} /> @@ -179,7 +143,7 @@ class ConfigFormUi extends React.Component { disabled={!this.props.onSubmit} defaultValue={get( this.props, - `values.configs[0].${schema.id}`, + `values.config.${schema.id}`, schema.defaultValue )} helpText={schema.ui.helpText} @@ -193,7 +157,6 @@ class ConfigFormUi extends React.Component { }), }, ].concat(schema.options || [])} - validations={schema.validations} validationError={schema.error} required={schema.required} /> @@ -207,20 +170,38 @@ class ConfigFormUi extends React.Component { id={schema.id} defaultValue={get( this.props, - `values.configs[0].${schema.id}`, + `values.config.${schema.id}`, schema.defaultValue )} name={schema.id} helpText={schema.ui.helpText} label={schema.ui.label} options={schema.options ? schema.options : []} - validations={schema.validations} validationError={schema.error} required={schema.required} /> ); } })} + {this.props.schema && ( + + )} {this.props.onSubmit && (