In the progress of upgrading Nifi-1.10.0 from Nifi-1.9.2,'flow.xml.gz' is copied to new app.However,the files storaged in registry are unchanaged.
as following message:
$ cat 4.snapshot | grep 'version'
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
"version" : "1.9.2"
How to update them to show 'version:1.10.0'?there is a way to commit group in Nifi-1.10.0 but TOO TROUBLE!ANY OTHER SUGGESTION?Thank you!
The version fields in registry will get updated the next time you save a new version of those flows. It doesn't cause any issues for the versions to remain as 1.9.2, those flows can still be imported and used in 1.10.0.
Related
This question already has answers here:
Parsing JSON with Unix tools
(45 answers)
Closed 3 years ago.
I have an automation script that I'm writing in Bash. I need to execute a perl script from within this and capture/parse one specific part of it's output and use it as a variable in order to complete the bash script's tasks.
For example:
echo "Creating database for "$custname
perl /home/dib/testing/addCustomer.cgi name=$custname prefix=$customerno
The perl script "addCustomer.cgi" will return JSON output of:
Content-Type: application/json; charset=UTF-8
{
"recordcount" : 1,
"status" : "OK",
"statusText" : "Add Customer: 40:Testing",
"customer" : [
{
"address" : "",
"city" : "",
"country" : "US",
"description" : "",
"email" : "",
"endDate" : "0000-00-00 00:00:00",
"frontendurl" : "",
"phone" : "",
"prefix" : "testing",
"startDate" : "0000-00-00 00:00:00",
"state" : "",
"customerID" : "40",
"subscriberName" : "Testing",
"url" : "",
"zip" : ""
}
],
"timestamp" : 1559163419
}
What I need to capture is the customerID number, stick it into a variable, and use it to finish the bash script. Is something like this possible? I always see parsing or passing from bash to perl but not the other way around.
Append this to your Perl command:
| sed 1d | jq -r '.customer[].customerID'
Output:
40
I assume there's one header line.
Hi i would like to know how to setup sublime text 3 build system to execute bash script threw MSYS bash.
I have try the following build system :
{
"cmd" : ["bash", "$file"],
"selector" : "source.shell",
"path" : "C:/MinGW/msys/1.0/bin"
}
It does look to work, but it can't find gcc, i have try to add multiple path this way :
"path" : "C:/MinGW/msys/1.0/bin:C:/MinGW/bin"
But the C: looks to break the thing.
I have also try this :
"path" : ["C:/MinGW/msys/1.0/bin", "C:/MinGW/bin"]
But it fail also as path is waiting for a string only
"path" :"C\:/MinGW/msys/1.0/bin:C\:/MinGW/bin"
"path" :"C:/MinGW/msys/1.0/bin\:C:/MinGW/bin"
"path" :"${C:/MinGW/msys/1.0/bin}:${C:/MinGW/bin}"
Also fail ...
"path" : "/c/MinGW/msys/1.0/bin:/c/MinGW/bin"
"path" : "/MinGW/msys/1.0/bin:/MinGW/bin"
Same for those ...
Any working suggestion would be greatly appreciated.
To install msys bash with sublime text 3 you just have to copy this in
a new build system:
{
"cmd" : ["bash", "$file"],
"selector" : "source.shell",
"windows": {
"path" : "$path;c:\\mingw\\bin;c:\\mingw\\msys\\1.0\\bin",
"cmd" : ["bash", "--login", "-i", "-c", "cd \"$file_path\"; \"$file\""]
},
"osx": {
"path" : "$PATH:/usr/local/bin:/usr/X11R6/bin:/opt/X11/bin:/usr/texbin"
}
}
thanks to macite :
https://github.com/macite/sublimebashbuildsystem/blob/master/Bash.sublime-build
For my research I should import Russian Wikipedia's dump into Elasticsearch 2.2. But instead of importing dump I decided to work with indices published by Wikimedia (http://dumps.wikimedia.org/other/cirrussearch/). To work with it I found an article https://www.elastic.co/blog/loading-wikipedia and tried to use author's scripts for my problem (just replaced some export-statements). But there's a problem in the Step 2.
It is my version of script for Step 2:
export es=localhost:9200
export site=ru.wikipedia.org
export index=ruwiki
curl -XDELETE $es/$index?pretty
curl -s 'https://'$site'/w/api.php?action=cirrus-settings-dump&format=json&formatversion=2' |
jq '{ analysis: .content.page.index.analysis, number_of_shards: 1, number_of_replicas: 0 }' |
curl -XPUT $es/$index?pretty -d #-
curl -s 'https://'$site'/w/api.php?action=cirrus-mapping-dump&format=json&formatversion=2' |
jq .content |
sed 's/"index_analyzer"/"analyzer"/' |
sed 's/"position_offset_gap"/"position_increment_gap"/' |
curl -XPUT $es/$index/_mapping/page?pretty -d #-
And the result
{
"acknowledged" : true
}
{
"acknowledged" : true
}
{
"error" : {
"root_cause" : [ {
"type" : "action_request_validation_exception",
"reason" : "Validation Failed: 1: mapping source is empty;"
} ],
"type" : "action_request_validation_exception",
"reason" : "Validation Failed: 1: mapping source is empty;"
},
"status" : 400
}
I also tried to use author's script just for test. There's the same error. I don't know what to do. Please, help to fix it.
The Wikipedia dumps are currently exported from ElasticSearch 1.7.5. Most likely (I haven't tested) the current mapping is not compatible with ES 2.2. It is likely worthwhile to try using the older version of ES.
Edit: The latest dumps are now compatible with elasticsearch 2.x
My document structure looks like this:
{"name":"John", "age":32, ...other fields}
All other fields need not be initialized, only name and age. I want to make a script that takes in name and number
./client.sh John 32
and in the script, it will do something like
db.client.insert({"name":$1,"age":$2});
how to achieve this?
Here is a simple example script that works
#!/bin/bash
if [ $# -lt 2 ]
then
echo "USAGE: $0 name age"
exit 1
fi
mongo <<EOF
use test
db.client.insert({"name":"$1", "age":$2})
db.client.find()
EOF
It assumes that mongo is installed and in your path and that you have the client collection in the test database.
A sample run below
hduser#localhost:~/temp$ ./mongo_ins.sh "overflow" 20
MongoDB shell version: 2.6.10
connecting to: test
switched to db test
WriteResult({ "nInserted" : 1 })
{ "_id" : ObjectId("56b35d134c24bf7c1190cfb3"), "name" : "Stack", "age" : 1 }
{ "_id" : ObjectId("56b35dabe23223802ea3fa61"), "name" : { }, "age" : 10 }
{ "_id" : ObjectId("56b35ebbd69a0abeeb817fe3"), "name" : "overflow", "age" : 20 }
bye
Hope this helps
I am running a shell script which produces below output.
Built-By : apache
Created-By : Apache Maven
Implementation-Title : testApp
Implementation-Vendor-Id : com.test.app
Implementation-Version : testBox
Manifest-Version : 1.0
appname : TestStar
build-date : 02-03-2014-13 : 41
version : testBox
Expecting the below output: (Please ignore _ underscore)
Built-By_________________: apache
Created-By_______________: Apache Maven
Implementation-Title_____: testApp
Implementation-Vendor-Id_: com.test.app
Implementation-Version___: testBox
Manifest-Version_________: 1.0
appname__________________: TestStar
build-date_______________: 02-03-2014-13 : 41
version__________________: testBox
Someone Please help me. I am iterating two arrays to print these values.
show me your code.
maybe this would help:
#!/bin/bash
key=("appname" "version" "Created-By")
value=("TestStar" "testBox" "Apache Maven")
for i in "${!key[#]}";do
printf "%-15s %s\n" "${key[i]}" "${value[i]}"
done