Commit Graph

1789 Commits

Author SHA1 Message Date
uboness ea91c1e617 third attempt to fix the failing tests windows
Original commit: elastic/x-pack-elasticsearch@30bb93ce4a
2015-05-22 11:39:09 +02:00
Robert Muir 8ea126de90 switch to plugin pom
Original commit: elastic/x-pack-elasticsearch@6fcfa52959
2015-05-21 23:01:57 -04:00
uboness 8e13a03069 fixing failing test on windows... now for realz
Original commit: elastic/x-pack-elasticsearch@159144f18c
2015-05-22 00:41:32 +02:00
Robert Muir 19e1b5597c Merge pull request elastic/elasticsearch#50 from rmuir/parent_cleanups_forbidden
Sync up with elasticsearch-parent changes:

Original commit: elastic/x-pack-elasticsearch@420b0cbd3e
2015-05-21 17:15:35 -04:00
Robert Muir b34b18be3f Remove duplicate test config
Original commit: elastic/x-pack-elasticsearch@2acd8bdf8c
2015-05-21 17:13:28 -04:00
uboness 47e50008a0 fixing failing test on windows
Original commit: elastic/x-pack-elasticsearch@5af44b88d2
2015-05-21 22:00:41 +02:00
Robert Muir 6d66e0f4f5 Resolve paths against environment
Original commit: elastic/x-pack-elasticsearch@7e30f66bc0
2015-05-21 12:25:20 -04:00
Robert Muir e3270183ef Fix this in a simpler way
Original commit: elastic/x-pack-elasticsearch@40bbb991d1
2015-05-21 12:15:36 -04:00
Robert Muir 5f1cfd025c restore executions section here
Original commit: elastic/x-pack-elasticsearch@0ed3d2c5af
2015-05-21 12:05:04 -04:00
Robert Muir e8ee650694 Sync up with elasticsearch-parent changes:
* removes lots of duplicate pom logic
* removes duplicate forbidden API logic
* fixes new forbidden API violations

Original commit: elastic/x-pack-elasticsearch@1fc5c6f79e
2015-05-21 11:49:33 -04:00
Martijn van Groningen 1bdd84bcb2 test: Add a simple runner that allows to run Watcher from the IDE and work out of the box with Sense.
Original commit: elastic/x-pack-elasticsearch@8c4100258e
2015-05-21 14:44:13 +02:00
Martijn van Groningen bbcfecbe90 test: added 'cluster:monitor/nodes/info' role for the test user
Original commit: elastic/x-pack-elasticsearch@78144d3313
2015-05-21 13:35:19 +02:00
Martijn van Groningen 39f83974ef test: added missing roles for the test user
Original commit: elastic/x-pack-elasticsearch@36f6d36817
2015-05-21 12:41:30 +02:00
Martijn van Groningen 2861f8ce21 test: Add more Shield related tests for testing the Watcher roles.
Original commit: elastic/x-pack-elasticsearch@482d8fe65c
2015-05-21 12:05:44 +02:00
Martijn van Groningen 284a60e16d stats: fix npe during serialization
Original commit: elastic/x-pack-elasticsearch@3233836d0b
2015-05-21 11:38:24 +02:00
Martijn van Groningen 60c7e92ced stats: fix serialization error
Original commit: elastic/x-pack-elasticsearch@5210ca9ee7
2015-05-21 11:29:32 +02:00
Martijn van Groningen 283445b9d8 stats: fix npe in rest layer
Original commit: elastic/x-pack-elasticsearch@43b3fcf3e7
2015-05-21 11:12:52 +02:00
Martijn van Groningen c3dd74df7f Expose the current executing watches as part of the Watcher stats API.
The following additional information will be shown per watch that is executing:  `watch_id`, `watch_execution_id`, `triggered_time`, `execution_time`, `execution_phase` (whether it is execution an input, condition or an action) and `stack_trace` (useful for us when a customer reports an issue :) ).

The stats api will by default include the executing watches in the response. In order to control this, a `metric` option has been added, which can be specified as query string argument or as last path element in the stats api url. By default the watcher stats API will only return the basic statistics that are already there.

The `metric` option has the following values:
* `current_watches` - Include the current executing watches in the response.
* `_all` - Include all metrics in the stats response. Not very useful now, but when we expose more metrics in this api it will be more useful.

Original commit: elastic/x-pack-elasticsearch@093bef9bb3
2015-05-21 10:51:51 +02:00
Chris Cowan 1c92b3976b Adding fielddata utilization
Original commit: elastic/x-pack-elasticsearch@f92ef0e38d
2015-05-20 08:57:42 -07:00
Brian Murphy 81d19d3468 [REST-TEST] Remove check for snapshot.
This change removes the check for snapshot in the info test.

Original commit: elastic/x-pack-elasticsearch@5eb0618b56
2015-05-20 09:58:05 -04:00
uboness 7d12d314ad moving version to 2.0.0-SNAPSHOT
Original commit: elastic/x-pack-elasticsearch@58e7b38de5
2015-05-20 15:29:52 +02:00
uboness 0a3c85803c moving version to 1.0.0-Beta1
Original commit: elastic/x-pack-elasticsearch@d88dd97379
2015-05-20 14:23:05 +02:00
uboness 68d0420dd2 Added maven deployment profiles
Original commit: elastic/x-pack-elasticsearch@37a867aa26
2015-05-20 13:36:36 +02:00
uboness 8218170711 Added `execution_result.condition.met` field
Until today we could not search on the `met` field in the condition result. The reason for that is that this field was index as part of the condition result type only, and we disable the indexing for all condition results (to avoid mapping conflicts).

 This commit pulls the `met` condition one level higher and enables its mapping. For now (beta1) we can live with the duplication of the condition result source (were the `met` is not placed in both the condition result type and on the condition result itself). Later we should remove the duplication though.

 An example of a  "compare" condition result now looks like:

 ```
 "condition": {
    "met": true,
    "compare": {
       "met": true,
       "resolved_value": 1
    }
 }
 ```

Original commit: elastic/x-pack-elasticsearch@74a3372c25
2015-05-20 09:46:42 +02:00
Chris Cowan 848b90a720 Adding file descriptors to watcher examples
Original commit: elastic/x-pack-elasticsearch@9d5ee156e8
2015-05-19 14:22:10 -07:00
Martijn van Groningen 2ede3c29d8 test: removed unused method
Original commit: elastic/x-pack-elasticsearch@465bf69daa
2015-05-19 16:58:08 +02:00
uboness 9aef7bb52b Added `compare` condition
A simple `condition` that compares a path into the model in the execution context to a value. The comparison is based on the following possible operators: `eq`, `not_eq`, `lt`, `lte`, `gt`, `gte`.

The following example shows a `compare` condition that checks if the total hits in the payload is greater or equal to 5.

```
{
	"compare" : {
		"ctx.payload.hits.total" : { "gte" :  "5" }
	}
}
```

Original commit: elastic/x-pack-elasticsearch@6d4f2bbf10
2015-05-19 04:17:12 +02:00
uboness 9e5fa64e03 Fixed watch_history template for Index Action
Fixed the mappings of the index action fields such that the `index` and `type` of the index response won't be analyzed.

Original commit: elastic/x-pack-elasticsearch@5db8bf6a33
2015-05-19 03:11:56 +02:00
Chris Cowan ca08fb731f Adding readme to watchers
Original commit: elastic/x-pack-elasticsearch@67177df520
2015-05-18 11:16:09 -07:00
Chris Cowan 835c92f32e Adding dependencies
Original commit: elastic/x-pack-elasticsearch@d24f14bedb
2015-05-18 10:54:40 -07:00
Chris Cowan 50324e231a Adding watchers and testing framework
Original commit: elastic/x-pack-elasticsearch@88b1619192
2015-05-18 10:16:23 -07:00
Martijn van Groningen 4b3e1592ca Test: apply `shield.user` property only once,
rely on http header to be send for Shield authentication
and finally omit the manage_watcher role from the test user.

Original commit: elastic/x-pack-elasticsearch@57a6366119
2015-05-18 18:47:06 +02:00
Martijn van Groningen 00c5c5c8b6 Test: Added a test that verifies that we fail with 403 when the user doesn't have the `manage_watcher` role.
Original commit: elastic/x-pack-elasticsearch@4776bbdd11
2015-05-18 17:16:00 +02:00
Martijn van Groningen 511ac9f6a9 Test: Use internalTestCluster() instead of internalCluster()
Original commit: elastic/x-pack-elasticsearch@a2b72000c8
2015-05-18 13:26:46 +02:00
Martijn van Groningen 6404b2c7e5 Test: clear unicast temporal response list before we stop the elected master node.
Original commit: elastic/x-pack-elasticsearch@0b2675f9ff
2015-05-18 13:06:42 +02:00
Martijn van Groningen 1db5d1e37d Test: fix build failure where randomly a restricted header was used.
Original commit: elastic/x-pack-elasticsearch@c3892181ab
2015-05-18 12:41:00 +02:00
uboness b11f457fb7 Updated the watch_history template
- Disabled the search request body/template fields as they're too volatile to have mappings (applied for both for `search` input and transform)
- Disabled watch level transform result payload

Original commit: elastic/x-pack-elasticsearch@f69b237234
2015-05-16 02:13:17 +02:00
Martijn van Groningen a52a833264 test: change test logging
Original commit: elastic/x-pack-elasticsearch@2fe4619b4f
2015-05-15 12:50:36 +02:00
uboness 912bd1299b Introduced version name to the info API
Holds the name of the version as it is defined in the `pom.xml` (different than the version number that is automatically generated by `WatcherVersion`)

Original commit: elastic/x-pack-elasticsearch@b6cf221f63
2015-05-15 04:54:33 +02:00
uboness ba5f25f73c Updated `WatcherVersion` with min es compatibility to 1.5
Original commit: elastic/x-pack-elasticsearch@a48048aae4
2015-05-15 03:07:36 +02:00
Brian Murphy 7c1497ae3b [TEST] Ensure the license is enabled when starting watcher
This change adds a check to make sure that the license is enabled when starting watcher in the tests.
This avoids a race-condition where a test might run before the license manager had a chance to start.

Original commit: elastic/x-pack-elasticsearch@0b9d0da5d4
2015-05-14 18:22:09 -04:00
Brian Murphy 54926ec336 Fix escaping of mustache strings.
I think the escaping done in XMustacheFactory (and by extension JsonEscapingMustacheFactory in core) is broken.
You cannot just escape any control character by sticking a '\' in front of it. For example a new line character it '\n' but this will be rendered as a line break. Simply prepending a '\' to this just results in a '\' and then a new line !
Added support for different escaping strategies based on the XContentType of a template for XMustacheEngine.
Currently only JSON escaping is supported using jackson.JsonStringEncoder.
Templates will be prepended with __<contentType>__:: when the content type is set. If this is set to JSON we will json escape the content.

Fixes: elastic/elasticsearch#404

Original commit: elastic/x-pack-elasticsearch@1400cba659
2015-05-14 14:35:16 -04:00
jaymode 09621f1267 allow the system truststore to be used if one is not specified
A truststore should not be required as the default system truststore can be used
to validate certificates that have been signed by most commercial CAs.

Additionally, the HttpClient is now a lifecycle component to prevent out of memory
exceptions when starting up with a bad configuration; when an exception is thrown
in the constructor, Guice will continue to try to create the object until the system runs
out of memory.

Closes elastic/elasticsearch#476

Original commit: elastic/x-pack-elasticsearch@2333e47ac1
2015-05-14 09:45:43 -04:00
Brian Murphy 5796a771c0 Chain transform was incorrectly assuming that all transforms had to be objects.
The chain transform :
```
  "transform" : {
    "chain" : [
      {
        "search" : {
          "search_type" : "count",
          "indices" : [ "logstash-*" ],
          "body" : {
            "query" : {
              "match" : { "priority" : "error"}
            }
          }
        }
      },
      {
         "script" :  "return [ error_count : ctx.payload.hits.total ]"

      }
    ]
  },
```
Was failing because the chain transform (wrongly) refused to parse the script string as a transform.
This change will allow the transforms to determine what should parse or not.

Fixes: elastic/elasticsearch#475

Updates after review

Original commit: elastic/x-pack-elasticsearch@78c1a2498d
2015-05-13 22:23:08 -04:00
uboness 926e39d21e Disabled mapping for transform results
Transform results may product different payloads per watch/execution. It means that if the resulted transformed payload is mapped and indexed, there's a high chance for mapping conflicts and thus failures.

For this reason, this commit disables the mapping of all `transform` results (on both the watch and the action levels).

This commit also changes the field name of the transform result from `transform_result` to just `transform` (aligned with other result field names - `input`, `condition` and `actions`)

 Fixes elastic/elasticsearch#472

Original commit: elastic/x-pack-elasticsearch@2c6d4f5182
2015-05-13 20:18:45 +02:00
Martijn van Groningen aba3f8f34c Revert TP SAME change for the service api
Original commit: elastic/x-pack-elasticsearch@f7e52fda96
2015-05-13 14:03:10 +02:00
jaymode b66ddbde3f add snapshot repo to resolve parent pom
Original commit: elastic/x-pack-elasticsearch@80214bbe81
2015-05-13 07:49:34 -04:00
jaymode 5758ca3c7b update to make elasticsearch 2.0 the minumim required version
This change makes the license plugin compatible with elasticseach-2.0.0-SNAPSHOT. This project
now uses the elasticsearch-parent pom to standardize the build with core. As part of this, the
Java security manager is enabled and all tests pass with the security manager enabled.

Closes elastic/elasticsearch#46

Original commit: elastic/x-pack-elasticsearch@5f471ea298
2015-05-13 07:14:10 -04:00
Martijn van Groningen af1d4ad79c Use ThreadPool.Names.SAME executor in stats and service apis.
Original commit: elastic/x-pack-elasticsearch@03c52668e0
2015-05-13 10:44:15 +02:00
Brian Murphy f14fe49dfa Use a different separator in `Wid`
`#` is a reserved character in the URL spec and must be escaped to be used. This change uses `-` instead.

Fixes: elastic/elasticsearch#467

Original commit: elastic/x-pack-elasticsearch@a75eb89cb8
2015-05-12 17:26:28 -04:00