Closed greenx closed 8 years ago
@greenx Please attach the complete content pack which triggers the error.
attached in bottom
By the way, a rollback in case of failure does not work. Each pattern must be deleted as much time, how many times tried to apply content pack!
Hi @greenx,
Just to double check: does your _swift_expirer
grok pattern has a new line in it? At least the content pack you posted in the issue has one.
@greenx As a quick side note, you should upload the JSON file of the content pack and not paste it into the comment field as text.
Thank you @greenx!
The new line was only in the copied text, I guess it was a typo while copy/pasting the long text.
I have been able to reproduce the issue you described, will create a patch for it soon.
Hi, ALL! I have two similar graylog systems (test->prod). I created on test system: a few syslog udp inputs and grok patter extractor on each input. I wanted copy this setting to production system. In "Create a content pack" I filling field "Name", "Description", "Category", selecting needed "inpurs" and "grok pattern" (I don't have output, stream, a dashboard) and download content pack. Next, on product system in "Content packs" - I pressed "import Content pack", select file and upload him. Now, I select my content pack and press "apply content" and receive error... something like "error see logs"
Expected Behavior
I expected that import settings (inputs,extractors, grok patterns)
Current Behavior
in logs I saw the following:
I understand that there are two errors: 1.) Wrong text in error description. I don't use dashboards (absolutely). In this place - https://github.com/Graylog2/graylog2-server/blob/9dcad95d1469384fcb57173676dbf7d5a27e2572/graylog2-server/src/main/java/org/graylog2/bundles/BundleImporter.java#L138
2.) And main error - "Missing parameters source_field or target_field." 2.1.) In my json - target_field is empty:
2.2.) Next, I found it string
That is, the field can be left blank? Here - https://github.com/Graylog2/graylog2-web-interface/blob/eb084699edf5686bf124b4086d81ecfdc2e3fb2c/app/controllers/ExtractorsController.java#L137
2.3.) In this case, adding grok patter always is TRUE in this code:
Here - https://github.com/Graylog2/graylog2-server/blob/9dcad95d1469384fcb57173676dbf7d5a27e2572/graylog2-server/src/main/java/org/graylog2/bundles/BundleImporter.java#L312
Possible Solution
I do not know much about the graylog - maybe it will be enough to change a logical expression.
Steps to Reproduce (for bugs)
Environment