I'm trying to add a static value field to the ops agent without success. This is the processor I'm using:
modify_fields:
type: modify_fields
fields:
env:
static_value: somenv
Also tried:
modify_fields:
type: modify_fields
fields:
env:
default_value: somenv
I just need all the documents sent by that machine to have a "env" field with value "someenv"
The error I'm getting is "env field not found"
Thank you
The issue was this feature was not available in the version I was using (2.16), so I upgraded to 2.18 and now works.
Also, need to follow the LogEntry structure
modify_fields:
type: modify_fields
fields:
jsonPayload.env:
static_value: somenv
Also record_log_file_path property which wasn't working is working now.
Related
I am new to using Django drf schema generation. I installed and configured the schema according to the documentation. It generates the OpenAPI schema. Now I want to customize the choice field representation and add some description in front of each field.
Current schema choice field is like below:
condition:
enum:
- used
- new
- like new
type: string
nullable: true
I want the following:
condition:
enum:
- used: "for used items"
- new: "for new items"
- like new: " brand new items"
type: string
nullable: true
In the documentation I could find little on how to customize the AutoSchema class but that was above my knowledge. I would be grateful if someone can help me on how can I override the schema methods to represent customize fields?
Here I can read that when configuring a prospect I can add a custom field to the data, which later I can use for filtering.
So for example I can write
- type: log
paths:
- /my/path/app1.csv
fields:
app_name: app1
- type: log
paths:
- /my/path/app2.csv
fields:
app_name: app2
This means that anytime I will have a new CSV file to track I have to add it to the filebeat.yml file adding the custom app_name field accordingly.
I was wondering if I could use a regex with a capture group in the prospect definition to "automatically" track any new file and assign the right app_name value. Something like this:
- type: log
paths:
- /my/path/(.*).csv
fields:
app_name: \1
What do you think? I didn't find any documentation regarding this possibility with the fields feature.
As adviced here, I can use the source Filebeat field to filter the data. This field is the path of the harvested files, so no other field is required to filter.
I've written a piece of code that adds and retrieves entities from the Datastore based on one filter (and order on the same property) - that worked fine. But when I tried adding filters for more properties, I got:
PreconditionFailed: 412 no matching index found. recommended index is:- kind: Temperature properties: - name: DeviceID - name: created
Eventually I figured out that I need to create index.yaml. Mine looks like this:
indexes:
- kind: Temperature
ancestor: no
properties:
- name: ID
- name: created
- name: Value
And it seems to be recognised, as the console shows:
that it has been updated
Yet when I run my code (specifically this part with two properties), it doesn't work (still getting the above-mentioned error) (the code is running on the Compute Engine).
query.add_filter('created', '>=', newStart)
query.add_filter('created', '<', newEnd)
query.add_filter('DeviceID', '=', devID)
query.order = ['created']
Trying to run the same query on the console produces
Your Datastore does not have the composite index (developer-supplied) required for this query.
error. Search showed one other person who had the same issue and he managed to fix it by changing the order of the properties in the index.yaml, but that is not helping in my case. Has anybody encountered a similar problem or could help me with the solution?
You'll need to create the exact index suggested in the error message:
- kind: Temperature
ancestor: no
properties:
- name: DeviceID
- name: created
Specifically, the first property in the index needs to be DeviceID instead of ID and the last property in the index needs to be the one you're using in the inequality filter (so you can't have Value as the last property in the index).
I have created a vanilla sitecore 8.1 MVC instance and trying to get home item by displayname using fast query but getting null value:
Do I need to do any configuration settings in web.config.I am passing "Home" in this function.
I have set useDisplayName="true" attribute in <LinkManager> element in Sitecore.config file also.
Thanks
You may need to query the field by its name with a lowercase "n":
fast:/sitecore/content//*[#__Display name='{0}']
I am trying to persist a domain object that contains fields of type java.util.List. I am using springdata 3.2.0.RELEASE + Neo4j 2.1.2 and persisting the object using neo4jTemplate.save API.
The questions is:
How to handle a scenario where domoain object has a list.
appreciate your assistance
Utpal.
I am getting the following error:
INFO : org.springframework.data.neo4j.fieldaccess.DelegatingFieldAccessorFactory - No FieldAccessor configured for field: interface java.util.Set ratings rel: false idx: false
java.lang.IllegalArgumentException: New value must be a Set, was: class java.util.ArrayList
at org.springframework.data.neo4j.fieldaccess.RelationshipHelper.createSetOfTargetNodes(RelationshipHelper.java:124)
at org.springframework.data.neo4j.fieldaccess.RelatedToFieldAccessor.createSetOfTargetNodes(RelatedToFieldAccessor.java:82)
at org.springframework.data.neo4j.fieldaccess.RelatedToCollectionFieldAccessorFactory$RelatedToCollectionFieldAccessor.setValue(RelatedToCollectionFieldAccessorFactory.java:66)
at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.setValue(DefaultEntityState.java:113)
Use Set rather than List. Neo4j doesn't support order.
It will help.