I am working through a Nifi process group that generates a flowfile. I am trying to update the filename attribute, but I notice a single quote gets added to the file too.
In there, you see #{snmp.hostname}-${now()}.json
This does work, but when I look at the output I see:
I don't see the quotes when I keep the flowfile filename as is. Here is my PutFile settings, pretty much the default:
Here is what is looks like when I don't update attribute, you see the file: 6fd0fcec-c838-4938-a600-5dbe99c4a370 (I do notice a leading space in that flowfile name too?).
Running NiFi 1.16.0 on a RHEL 8.5 machine.
Okay I found the problem. The problem was the date format in now() contained spaces. It seems NiFi will inject a quote around the file name if there are spaces. Replacing ${now()} with ${now():format("yyyy-MM-dd_HH:mm:ss.SSS'Z'", "America/Los_Angeles")} gets rid of the spaces and leads to:
And that solves the problem.
Related
I am trying to parameterize my request using CSV Data Set Config. My input includes double quotes("), colon(:) and brackets([])
Eg: fiscal_year ":["2021",2019]"
Had tried with it, but in the actual results its passing as "fiscal_year "":[""2021""
Please share your inputs on what am i missing on the input paramter.
I don't think it's due to double quotes("), colon(:) and brackets([]), CSV stands for comma-separated values so JMeter treats it as a delimiter and reads everything including to the first comma.
So you might want to change the "Delimiter" to something else:
It's hard to come up with a comprehensive solution without seeing at least couple of lines from your CSV file and the way you're parameterizing the HTTP Request with JMeter Variables
In case you have one entry per line in the CSV file it might be easier to go for __StringFromFile() function which reads next line from the file each time it's being called. See Apache JMeter Functions - An Introduction for more information.
I want to insert a comma between braces in a FlowFile.
I receive json objects and merge them together with a process. After the merge I get this:
{"tag":"a","bag":"b"}{"tag":"c","bag":"d"}
I want it to end up like this after the ReplaceText processor:
{"tag":"a","bag":"b"},{"tag":"c","bag":"d"}
However my ReplaceText process doesn't work. I have it set up like this:
With this process, nothing gets replaced.
Am I doing something wrong?
I suggest to add demarcator in MergeContent if you use it in you process
But you variant still must work. I try this on 1.10 and content has been changed.
I am using JMeter 5.1.1.
I have a CSV file looks like this
When I call HTTP Request like this
I get this
Jmeter doesn't take the value but just pass the name of the variable to the URI.
But if I take the second column CustomerParam by putting ${CustomerParam} , then JMeter will grab the value (instead of the name of the variable).
I am wondering how can I get the values of the first column ?
Thanks.
I found the root cause.
When creating the CSV file using the newest Microsoft Excel 365 , save it as CSV , not CSV UTF-8.
When I saved the file using CSV, JMeter works perfectly fine. But when I saved it using CSV UTF-8, then the issue I described earlier does appear.
If Variables are referenced as follows:
${VARIABLE}
If an undefined function or variable is referenced, JMeter does not report/log an error - the reference is returned unchanged. For example, if UNDEF is not defined as a variable, then the value of ${UNDEF} is ${UNDEF}.
Input the Variable name in your CSV Data Set Config as follows (If your CSV data set looks exactly above where variable names are present in the first line):
Or, you can just remove the variable names from the first line of your CSV file and make the config as below:
I cannot reproduce your issue using the same CSV Data Set config:
The evidence that the variables have been read (assumes Debug Sampler and View Results Tree listener combination)
So double check the following:
Your CSV file integrity as it might be an issue with the data itself, i.e. if there is a BOM at the beginning - you will have to remove it as the BOM will be added to the first variable name (use aforementioned Debug Sampler and View Results Tree listener to verify which variables are defined)
An problem with the CSV file operating-system wise (i.e. typo in location or file permission issue). Normally JMeter should report any errors connected with failure of reading the CSV file in jmeter.log
I am trying to modify the name of some files with NiFi getting a value from a JSON an adding to the original filename (for example filename.csv (original name) + january (name that provides the incoming JSON)). To do so, I am redirecting the CSV files to updateAttribute to change de Filename.
From the other hand, I am receiving a JSON that has an attribute that will be part of the name of the file.
On the evaluateJsonPath the configuration is the next (I am receiving it correctly the value):
And finally I am trying to merge the values in the UpdateAttribute processor (here is where it doesn't work properly):
The response I am getting is _filename.csv
You have quotes around name inside your Expression Language expression, try
${name}_${filename} or
${name:append('_'):append(${filename})}
I have a Jmeter script which will fire some HTTP requests. From the requests i am getting the required values to my output.
In the jmeter.properties file i have mentioned as follow:
# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters
# Default:
#jmeter.save.saveservice.default_delimiter=|
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.save-service.default_delimiter=\t
But it is not reflecting in my output.
How to resolve this issue?
I have the same problem. I've added to the jmeter.properties file the following lines:
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.default_delimiter=;
csvread.delimiter=;
Now Simple Data Writer saves results using ; to separate fields' values. But when I save data in the Aggregate Report element (by clicking the 'Save Table Data' button) the values in result aggregate.csv file are separated by ,
If you really did what you are describing in the code excerpt, then you forgot to uncomment fields by removing # before the concerned line.
Furthermore you are making a mistake in the property names, they should be:
jmeter.save.saveservice.default_delimiter=|
jmeter.save.saveservice.default_delimiter=\t
For full reference, see jmeter.properties.
But I am not sure to answer your question , as it is not clear though, can you clarify it.
Regards
Philippe M.