How to use session variable in StringBody of gatling?
I have defined my exec like,
val migrateAsset = exec(_.set("assetId", AssetIdGenerator.generateRandomAssetId()))
.exec(http("Migrate Asset")
.post(s"$url/asset/metadata")
.header("Content-Type", "application/json")
.header("Authorization", s"Bearer ${authToken}")
.body(StringBody(
s"""
|{
| "objectType" : "DocumentType",
| "fileName" : "main.xml",
| "locations" : [
| {
| "region" : "eu-west-1",
| "url" : "https://s3-eu-west-1.amazonaws.com/${bucketName}/${assetId}"
| },
| {
| "region" : "us-east-1",
| "url" : s"https://s3.amazonaws.com/${bucketName}/${assetId}"
| }
| ],
| "format" : "MAIN",
| "mimeType" : "text/plain"
|}
""".stripMargin
))
.check(status.is(200)))
In the body, I want same assetId to be passed for both eu-west and us-east regions. Since, assetId is randomly generated, I have stored it in session variable so as to make sure, I use same assetId for both locations.
But I cant pass assetId in StringBody format. It keeps giving me error like,
AssetsMigrationLoadSimulation.scala:31: not found: value
assetId
| "url" : "https://s3-eu-west-1.amazonaws.com/${bucketName}/${assetId}"
As Hans-Peter mentioned - your IDE has seen the ${...} that you're using to reference a gatling session parameter and decided that you are trying to do regular scala string interpolation - so it's put the 's' in front of the string.
remove the 's' and this should work
Related
I am using Openstack - Stein in CentOS 7.9
I was using python to collect data about the openstack nova performance, like server names and id in the openstack project, i have 3 instance(server) created, i can see all three instance in openstack cli, but when i connect to api mentioned in openstack, it provides no data or less data.
I refereed openstack documentation here
[root#centos-vm1 kavin(keystone_admin)]# openstack server list
+--------------------------------------+-----------------+--------+----------------------------------------+-------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-----------------+--------+----------------------------------------+-------+----------+
| 08cf6226-0303-4b4c-ba53-10af79b81dae | test_instance_3 | ACTIVE | test_networ_3=10.150.0.8 | | m1.tiny |
| 9986f205-82b3-4cbb-bcdc-fb32eab97c83 | test_instance_1 | ACTIVE | test_networ_2=10.100.0.5, x.x.x.x | | m1.small |
| d1c0f520-8540-432c-8fe1-554390fd79bf | test_instance_2 | ACTIVE | test_networ_1=10.50.0.8 | | m1.small |
+--------------------------------------+-----------------+--------+----------------------------------------+-------+----------+
My python code:
import requests,json
from six.moves.urllib.parse import urljoin
identity = {
"methods": ["password"],
"password": {
"user": {
"name": "admin",
"domain": { "id": "default" },
"password": "xxxxxxxxxxxxxxx"
}
}
}
OS_AUTH_URL = 'http://x.x.x.x:5000/v3'
data = {'auth': {'identity': identity}}
HEADERS = {'Content-Type': 'application/json', 'scope': 'unscoped'}
r = requests.post(
OS_AUTH_URL+'/auth/tokens',
headers = HEADERS,
json = data,
verify = False
)
auth_token = r.headers['X-Subject-Token'] # i got auth token
# server list
NOVA_URL="http://x.x.x.x:8774/v2.1"
HEADERS = {"X-Auth-Token" : str(auth_token)}
r = requests.get(
NOVA_URL+'/servers',
headers = HEADERS,
)
r.raise_for_status()
print(r.json())
Output :
{'servers': []}
help me, collect accurate data using api calls, thanks
According to api-ref List Servers doc, maybe you should add the project scope in the request.
By default the servers are filtered using the project ID associated with the authenticated request.
In my opinion, you could use openstacksdk to execute the operation, simply with the Connection object and list_servers method.
import openstack
conn = openstack.connect(
region_name='example-region',
auth_url='http://x.x.x.x:5000/v3/',
username='amazing-user',
password='super-secret-password',
project_id='33...b5',
domain_id='05...03'
)
servers = conn.list_servers()
I want to make a dynamic request using Gatling.
using Gatling we are getting to rest-API to which we are posting an SMS request I want that each request should be done with a different sent of mob no.
exec(http("Sms Delivery")
.post(s"/deliveries")
.body(StringBody(
s"""{ "template":
|{ "type":"inline", "inline":
| { "channels":
| "sms":{ "body":{ "layout":"{greeting}", "fragments":{ "greeting":{"en-US":"ABC123 Interested to hear about some jobs?"}}}} }} },
| "recipients":[ { "contactDetails":{ "mobileNumber" : "+1${Random.nextInt(123123123)}" } }],
| "requester": "${UUID.random.toString}"}""".stripMargin)).asJson
.check(status.is(202))
.check(jsonPath("$.messageId").ofType[String])
)
}
setUp(
scenario("Create message-Cmd")
.exec(createMessageServiceSms()).inject(
rampConcurrentUsers(0) to (6) during(1),
constantConcurrentUsers(5) during (testTime seconds)
)
)
Let suppose Gatling sends 100 requests the for all those requests my mob no remains the same for each request is same let say +12011705515.
However, I want all no. should be different.
The string is created only once, then parsed as Expression Language, which allows you to substitute in session attributes.
If you want custom functions like creating a UUID and calling Random.nextInt, you need to pass in a function to StringBody.
StringBody(_ =>
s"""{ "template":
|{ "type":"inline", "inline":
| { "channels":
| "sms":{ "body":{ "layout":"{greeting}", "fragments":{ "greeting":{"en-US":"ABC123 Interested to hear about some jobs?"}}}} }} },
| "recipients":[ { "contactDetails":{ "mobileNumber" : "+1${Random.nextInt(123123123)}" } }],
| "requester": "${UUID.random.toString}"}""".stripMargin)
)
The parameter that we discarded is the virtual user's Session.
Worth noting that you may have too few digits for the mobileNumber, but that's another issue than creating a dynamic request.
When I examine a ContactItem, all of the Email#Address values are null. I have tried settings the value then printing the value. The change is reflected in Outlook, however, no value can be retrieved via PowerShell.
Below are some snippets:
$Outlook=NEW-OBJECT –comobject Outlook.Application
$Contacts=$Outlook.session.GetDefaultFolder(10).items
$Contactsfolders = $Outlook.session.GetDefaultFolder(10).Folders
$testFolder = $Contactsfolders | Where-Object {$_.Name -eq 'Test Folder'}
$testContact = $testFolder.Items(1)
echo $testContact
$testContact.Email1Address = "BobDoe3#doe.com"
echo $testContact
Here is the output of the above execution. Note I've removed some of the uninteresting information to shorten.
First Echo
Application : Microsoft.Office.Interop.Outlook.ApplicationClass
Class : 40
Session : Microsoft.Office.Interop.Outlook.NameSpaceClass
ConversationTopic : John Doe
FormDescription : System.__ComObject
GetInspector : System.__ComObject
Importance : 1
LastModificationTime : 10/31/2017 5:57:04 PM
MAPIOBJECT : System.__ComObject
MessageClass : IPM.Contact
OutlookInternalVersion : 154971
OutlookVersion : 15.0
Saved : True
Sensitivity : 0
Size : 11614
Subject : Bob Doe
UserProperties : System.__ComObject
Account :
Anniversary : 1/1/4501 12:00:00 AM
AssistantName :
AssistantTelephoneNumber :
Birthday : 1/1/4501 12:00:00 AM
CompanyAndFullName : The Doe Company
Doe, Bob
CompanyLastFirstNoSpace :
CompanyLastFirstSpaceOnly :
CompanyMainTelephoneNumber :
CompanyName : The Doe Company
ComputerNetworkName :
CustomerID :
Department :
Email1Address :
Email1AddressType :
Email1DisplayName :
Email1EntryID :
Email2Address :
Email2AddressType :
Email2DisplayName :
Email2EntryID :
Email3Address :
Email3AddressType :
Email3DisplayName :
Email3EntryID :
FileAs : Doe, Bob
FirstName : Bob
FTPSite :
FullName : Bob Doe
FullNameAndCompany : Doe, Bob
The Doe Company
Gender : 0
GovernmentIDNumber :
Hobby :
Home2TelephoneNumber :
HomeAddress :
HomeAddressCity :
HomeAddressCountry :
HomeAddressPostalCode :
HomeAddressPostOfficeBox :
HomeAddressState :
HomeAddressStreet :
HomeFaxNumber :
HomeTelephoneNumber :
Initials : B.D.
InternetFreeBusyAddress :
ISDNNumber :
JobTitle :
Journal : False
Language :
LastFirstAndSuffix :
LastFirstNoSpace :
LastFirstNoSpaceCompany :
LastFirstSpaceOnly :
LastFirstSpaceOnlyCompany :
LastName : Doe
LastNameAndFirstName : Doe, Bob
Second Echo
Application : Microsoft.Office.Interop.Outlook.ApplicationClass
Class : 40
Session : System.__ComObject
Subject : Bob Doe
UnRead : False
UserProperties : System.__ComObject
Account :
Anniversary : 1/1/4501 12:00:00 AM
AssistantName :
AssistantTelephoneNumber :
Birthday : 1/1/4501 12:00:00 AM
Business2TelephoneNumber :
BusinessAddress :
BusinessAddressCity :
BusinessAddressCountry :
BusinessAddressPostalCode :
BusinessAddressPostOfficeBox :
BusinessAddressState :
BusinessAddressStreet :
BusinessFaxNumber :
BusinessHomePage :
BusinessTelephoneNumber :
CallbackTelephoneNumber :
CarTelephoneNumber :
Children :
CompanyAndFullName : The Doe Company
Doe, Bob
CompanyLastFirstNoSpace :
CompanyLastFirstSpaceOnly :
CompanyMainTelephoneNumber :
CompanyName : The Doe Company
ComputerNetworkName :
CustomerID :
Department :
Email1Address :
Email1AddressType :
Email1DisplayName :
Email1EntryID :
Email2Address :
Email2AddressType :
Email2DisplayName :
Email2EntryID :
Email3Address :
Email3AddressType :
Email3DisplayName :
Email3EntryID :
FileAs : Doe, Bob
FirstName : Bob
FTPSite :
FullName : Bob Doe
FullNameAndCompany : Doe, Bob
The Doe Company
Gender : 0
GovernmentIDNumber :
Hobby :
Home2TelephoneNumber :
HomeAddress :
HomeAddressCity :
HomeAddressCountry :
HomeAddressPostalCode :
HomeAddressPostOfficeBox :
HomeAddressState :
HomeAddressStreet :
HomeFaxNumber :
HomeTelephoneNumber :
Initials : B.D.
InternetFreeBusyAddress :
ISDNNumber :
JobTitle :
Journal : False
Language :
LastFirstAndSuffix :
LastFirstNoSpace :
LastFirstNoSpaceCompany :
LastFirstSpaceOnly :
LastFirstSpaceOnlyCompany :
LastName : Doe
LastNameAndFirstName : Doe, Bob
Something interesting that I've found while playing with different results and solutions.
I've found that both of the below queries results in the same matches which confuses me as I would have thought myString -ne '' is checking if the string is not empty. It appears that myString -ne '' and [String]::IsNullOrEmpty($myString) can both return true which seems impossible, but I think there are some cases where this could happen. Also note that IsNullOrEmpty function is extraordinarily faster.
$Listconstact=$session.GetDefaultFolder(10).Folders | %{$session.GetFolderFromID($_.EntryID).Items | where Email1Address -NE ''}
and
$Listconstact=$session.GetDefaultFolder(10).Folders | %{$session.GetFolderFromID($_.EntryID).Items | where {[String]::IsNullOrEmpty($_.Email1Address)}}
Results from tukan's answer:
VERBOSE: From:
VERBOSE: Subject: How are things
VERBOSE: From:
VERBOSE: Subject: See you soon
VERBOSE: From:
VERBOSE: Subject: Meeting Times
Try Something like this:
$Outlook=NEW-OBJECT –comobject Outlook.Application
$session=$Outlook.session
$Listconstact=$session.GetDefaultFolder(10).Folders | %{$session.GetFolderFromID($_.EntryID).Items | where Email1Address -ne ''}
#only one item
Write-Host "First element mail : $($Listconstact[0].Email1Address)`n`n"
#All mails
Write-Host "All element mail :"
$Listconstact.Email1Address
I'm kind of fuzzy on what you are tying to achieve. To me it seems you are mixing two things together - contacts & folders.
I'm not sure if you are trying to get information from Outlook emails or Address book (since you are using folder I guess it is the first). I'll gladly rectify the solution if it is not solving your issue.
Note: I don't have identical configuration but close enough: Outlook version: 15.0.0.4420 and PowerShell version: 4.0.30319.
I'll try my best to cover what I think you are trying to solve in my eyes - Getting all contacts' email addresses (adding also subject) from received emails in "Test Folder" #Outlook.
# Making sure we have the assembly loaded
Add-Type -assembly "Microsoft.Office.Interop.Outlook"
# saving the mapping
$olFolders = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -as [type]
# new object
$Outlook=NEW-OBJECT –comobject Outlook.Application
# setting the correct namespace
$namespace = $Outlook.GetNameSpace("MAPI")
# getting all folders in Outlook inbox
$inbox = $namespace.GetDefaultFolder($olFolders::olFolderInbox)
# filtering out all but the "Test Folder"
$targetFolder = $inbox.Folders.Item("Test Folder")
# iteration on email message
ForEach($emailMessage in $targetFolder.items) {
# getting all the information from the message
Write-Verbose -message "From: $($emailMessage.GetProperty) $($emailMessage.SenderEmailAddress)" -Verbose
Write-Verbose -message "Subject: $($emailMessage.Subject)" -Verbose
}
Why MAPI namespace? Well because the MSDN says so.
I would have thought myString -ne '' is checking if the string is not
empty.
Yes it does do that. The difference is that the method [String]::IsNullOrEmpty($myString) is checking for Null OR Empty in a string. In case, when you have a $null value then you can have both true. It is not empty and is $null. (for more see what does it mean to have a $null value)
Im trying to save some data in a postgreSQL database using cygnus-ngsi, but nothing happens. Im running all services in a docker container using docker-compose.
docker-compose.yml:
...
cygnus:
image: fiware/cygnus-ngsi:latest
hostname: cygnus
container_name: cygnus_fiware
volumes:
- ./config/cygnus/cygnus.conf:/opt/apache-flume/conf/agent.conf
- ./config/cygnus/grouping_rules.conf:/opt/apache-flume/conf/grouping_rules.conf
links:
- orion
- postgres
expose:
- "5050"
ports:
- "5050:5050"
postgres:
restart: always
image: postgres:latest
container_name: postgres_fiware
volumes:
- ./data/db/postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
expose:
- "5432"
environment:
- POSTGRES_USER=teste
- POSTGRES_DB=newdb
- POSTGRES_PASSWORD=123456789
agent.conf
cygnus-ngsi.sources = http-source
cygnus-ngsi.sinks = postgresql-sink
cygnus-ngsi.channels = postgresql-channel
#=============================================
# source configuration
# channel name where to write the notification events
cygnus-ngsi.sources.http-source.channels = postgresql-channel
# source class, must not be changed
cygnus-ngsi.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnus-ngsi.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnus-ngsi.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
# URL target
cygnus-ngsi.sources.http-source.handler.notification_target = /notify
# default service (service semantic depends on the persistence sink)
cygnus-ngsi.sources.http-source.handler.default_service = default
# default service path (service path semantic depends on the persistence sink)
cygnus-ngsi.sources.http-source.handler.default_service_path = /
# source interceptors, do not change
cygnus-ngsi.sources.http-source.interceptors = ts gi
# TimestampInterceptor, do not change
cygnus-ngsi.sources.http-source.interceptors.ts.type = timestamp
# GroupingInterceptor, do not change
cygnus-ngsi.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder
# Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
# see the doc/design/interceptors document for more details
cygnus-ngsi.sources.http-source.interceptors.gi.grouping_rules_conf_file = /opt/apache-flume/conf/grouping_rules.conf
# ============================================
# NGSIPostgreSQLSink configuration
# channel name from where to read notification events
cygnus-ngsi.sinks.postgresql-sink.channel = postgresql-channel
# sink class, must not be changed
cygnus-ngsi.sinks.postgresql-sink.type = com.telefonica.iot.cygnus.sinks.NGSIPostgreSQLSink
# true applies the new encoding, false applies the old encoding.
cygnus-ngsi.sinks.postgresql-sink.enable_encoding = false
# true if name mappings are enabled for this sink, false otherwise
cygnus-ngsi.sinks.postgresql-sink.enable_name_mappings = false
# true if the grouping feature is enabled for this sink, false otherwise
cygnus-ngsi.sinks.postgresql-sink.enable_grouping = false
# true if lower case is wanted to forced in all the element names, false otherwise
cygnus-ngsi.sinks.postgresql-sink.enable_lowercase = false
# the FQDN/IP address where the PostgreSQL server runs
cygnus-ngsi.sinks.postgresql-sink.postgresql_host = postgres
# the port where the PostgreSQL server listens for incomming connections
cygnus-ngsi.sinks.postgresql-sink.postgresql_port = 5432
# the name of the postgresql database
cygnus-ngsi.sinks.postgresql-sink.postgresql_database = newdb
# a valid user in the PostgreSQL server
cygnus-ngsi.sinks.postgresql-sink.postgresql_username = teste
# password for the user above
cygnus-ngsi.sinks.postgresql-sink.postgresql_password = 123456789
# how the attributes are stored, either per row either per column (row, column)
cygnus-ngsi.sinks.postgresql-sink.attr_persistence = row
# select the data_model: dm-by-service-path or dm-by-entity
cygnus-ngsi.sinks.postgresql-sink.data_model = dm-by-entity
# number of notifications to be included within a processing batch
cygnus-ngsi.sinks.postgresql-sink.batch_size = 100
# timeout for batch accumulation
cygnus-ngsi.sinks.postgresql-sink.batch_timeout = 30
# number of retries upon persistence error
cygnus-ngsi.sinks.postgresql-sink.batch_ttl = 10
# =============================================
# postgresql-channel configuration
# channel type (must not be changed)
cygnus-ngsi.channels.postgresql-channel.type = memory
# capacity of the channel
cygnus-ngsi.channels.postgresql-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnus-ngsi.channels.postgresql-channel.transactionCapacity = 100
Messages from docker-compose:
cygnus_fiware | time=2017-06-19T15:11:15.132Z | lvl=WARN | corr=4af15a0c-5501-11e7-aa0a-0242ac130004 | trans=508576db-1443-4c64-bfc9-629d1a0b250e | srv=espometeo | subsrv=/environment | comp=cygnus-ngsi | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[257] : [NGSIRestHandler] Unnecessary header
cygnus_fiware | time=2017-06-19T15:11:15.133Z | lvl=INFO | corr=89ac4c66-5501-11e7-850f-0242ac130004 | trans=3ae0dc99-de51-49a3-937f-42d887b7e7d7 | srv=espometeo | subsrv=/environment | comp=cygnus-ngsi | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[282] : [NGSIRestHandler] Starting internal transaction (3ae0dc99-de51-49a3-937f-42d887b7e7d7)
cygnus_fiware | time=2017-06-19T15:11:15.133Z | lvl=INFO | corr=89ac4c66-5501-11e7-850f-0242ac130004 | trans=3ae0dc99-de51-49a3-937f-42d887b7e7d7 | srv=espometeo | subsrv=/environment | comp=cygnus-ngsi | op=getEvents | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[299] : [NGSIRestHandler] Received data ({ "subscriptionId" : "5947d328e143997a02b11008", "originator" : "localhost", "contextResponses" : [ { "contextElement" : { "type" : "EstacaoMeteo", "isPattern" : "false", "id" : "Estacao3", "attributes" : [ { "name" : "Humidity", "type" : "float", "value" : "35.3", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2017-06-24T13:03:00" } ] }, { "name" : "Temperature", "type" : "float", "value" : "15.2", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2017-06-24T13:03:00" } ] } ] }, "statusCode" : { "code" : "200", "reasonPhrase" : "OK" } } ]})
cygnus_fiware | time=2017-06-19T15:11:36.141Z | lvl=INFO | corr=89ac4c66-5501-11e7-850f-0242ac130004 | trans=3ae0dc99-de51-49a3-937f-42d887b7e7d7 | srv=espometeo | subsrv=/environment | comp=cygnus-ngsi | op=persistAggregation | msg=com.telefonica.iot.cygnus.sinks.NGSIPostgreSQLSink[479] : [postgresql-sink] Persisting data at NGSIPostgreSQLSink. Schema (espometeo), Table (environment_estacao3_estacaometeo), Fields ((recvTimeTs,recvTime,fiwareServicePath,entityId,entityType,attrName,attrType,attrValue,attrMd)), Values (('1497885075139','2017-06-19T15:11:15.139Z','/environment','Estacao3','EstacaoMeteo','Humidity','float','35.3','[{"name":"TimeInstant","type":"ISO8601","value":"2017-06-24T13:03:00"}]'),('1497885075139','2017-06-19T15:11:15.139Z','/environment','Estacao3','EstacaoMeteo','Temperature','float','15.2','[{"name":"TimeInstant","type":"ISO8601","value":"2017-06-24T13:03:00"}]'))
cygnus_fiware | time=2017-06-19T15:11:36.142Z | lvl=WARN | corr=89ac4c66-5501-11e7-850f-0242ac130004 | trans=3ae0dc99-de51-49a3-937f-42d887b7e7d7 | srv=espometeo | subsrv=/environment | comp=cygnus-ngsi | op=processNewBatches | msg=com.telefonica.iot.cygnus.sinks.NGSISink[541] :
Seems like cygnus is getting all the data from the Orion and putting it right, but when i go to the postgresql db, there nothing. Some one already have this problem?
Persistance ERROR message:
cygnus_fiware | time=2017-06-22T09:45:06.092Z | lvl=ERROR | corr=N/A | trans=N/A | srv=N/A | subsrv=N/A | comp=cygnus-ngsi | op=processRollbackedBatches | msg=com.telefonica.iot.cygnus.sinks.NGSISink[398] : CygnusPersistenceError. -, null. Stack trace: [com.telefonica.iot.cygnus.sinks.NGSIPostgreSQLSink.persistAggregation(NGSIPostgreSQLSink.java:504), com.telefonica.iot.cygnus.sinks.NGSIPostgreSQLSink.persistBatch(NGSIPostgreSQLSink.java:231), com.telefonica.iot.cygnus.sinks.NGSISink.processRollbackedBatches(NGSISink.java:390), com.telefonica.iot.cygnus.sinks.NGSISink.process(NGSISink.java:372), org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68), org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147), java.lang.Thread.run(Thread.java:748)]
Cygnus start ERRORS:
cygnus_fiware | + exec /usr/lib/jvm/java-6-sun/bin/java -Xms512m -Xmx1g -Dcom.sun.management.jmxremote -Dflume.root.logger=INFO,console -Duser.timezone=UTC -Dfile.encoding=UTF-8 -cp '/opt/apache-flume/conf:/opt/apache-flume/lib/*:/opt/apache-flume/plugins.d/cygnus/lib/*:/opt/apache-flume/plugins.d/cygnus/libext/*' -Djava.library.path= com.telefonica.iot.cygnus.nodes.CygnusApplication -f /opt/apache-flume/conf/agent.conf -n cygnus-ngsi -p 8081
cygnus_fiware | /opt/apache-flume/bin/cygnus-flume-ng: line 232: /usr/lib/jvm/java-6-sun/bin/java: No such file or directory
cygnus_fiware | /opt/apache-flume/bin/cygnus-flume-ng: line 232: exec: /usr/lib/jvm/java-6-sun/bin/java: cannot execute: No such file or directory
There is a problem with PostgreSQL sink when cache is not enabled. It is described at this issue.
I solved the issue by changing false to true in agent.conf file: cygnus-ngsi.sinks.postgresql-sink.backend.enable_cache = true.
I'm looking for some suggestions/tips on how to sort and display the most recent record in a custom object (by a username). Basically, I am in a situation where I have an ActiveSync report with multiple usernames showing up on the report but I only want the most recent user's device information like device version , last contact time, etc... (See below the custom object's fields)
I've tried the following code but I am not getting the results I am looking for.
$ActiveSyncImport | Group-Object Identity| foreach-object { $_.group | sort-object LastSuccessSync | select -last 1}
Any help would be greatly appreciated
**Update as of 9/10/2013 at 8:40pm MST:
The output I am trying to get is like the following:
DeviceOS DeviceID
-------- --------
ApplDMPFWGAADFHW
Windows Phone7.10.7720 C3F755AAEB6CDE163838A106B00382F8
Android 4.2.2 3939303030303238323236343838
But, when I use my one-line of code I get the same results as my original ActiveSync Information not sorted or grouped.
ActiveSync Information:
RunspaceId : be1d8592-a70a-4322-a146-f6569a067af6
SamAccountName :
FirstSyncTime : 4/8/2013 9:49:31 PM
LastPolicyUpdateTime : 4/8/2013 9:50:41 PM
LastSyncAttemptTime : 9/9/2013 4:06:13 AM
LastSuccessSync : 9/9/2013 4:06:13 AM
DeviceType : iPhone
DeviceID : ApplC39xxxP9DDP7
DeviceUserAgent : Apple-iPhone3C3/1002.329
DeviceWipeSentTime :
DeviceWipeRequestTime :
DeviceWipeAckTime :
LastPingHeartbeat : 900
RecoveryPassword : ********
DeviceModel : iPhone3C3
DeviceImei :
DeviceFriendlyName : Black iPhone 4
DeviceOS : iOS 6.1.3 10B329
DeviceOSLanguage : en
DevicePhoneNumber :
MailboxLogReport :
DeviceEnableOutboundSMS : False
DeviceMobileOperator :
Identity : corp.XXXX.com/NorthAmerica/Users/lastname, firstname/ExchangeActiveSyncDevices/iPhone§ApplC39xxxP9DDP7
Guid : e7712106-3643-XXXX-XXXX-e20fa4376ad9
IsRemoteWipeSupported : True
Status : DeviceOk
StatusNote :
DeviceAccessState : Allowed
DeviceAccessStateReason : Global
DeviceAccessControlRule :
DevicePolicyApplied : Default ActiveSync Policy
DevicePolicyApplicationStatus : AppliedInFull
LastDeviceWipeRequestor :
DeviceActiveSyncVersion : 14.1
NumberOfFoldersSynced : 12
SyncStateUpgradeTime :