Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying retention policy in function node #130

Open
pkkrusty opened this issue Oct 1, 2022 · 1 comment
Open

Specifying retention policy in function node #130

pkkrusty opened this issue Oct 1, 2022 · 1 comment

Comments

@pkkrusty
Copy link

pkkrusty commented Oct 1, 2022

I've been browsing for a clear example of a function node that specifies tag, values, retention policy, precision that I can work from, but having no luck. I've tried the following, but not seeing anything show up the database.

temp=msg.payload[0];
msg.payload={
    fields: {
        value:temp.count
    },
    tags: {
        device:"Raspberry Pi"
    }
};
msg.retentionPolicy={
    value:"four_weeks"
    };
msg.measurement={
    value:"dbwrites"
    };
return msg;

and

temp=msg.payload[0];
msg.payload={
//    measurement:"dbwrites",
    fields: {
        value:temp.count
    },
    tags: {
        device:"Raspberry Pi"
    }
};
msg.retentionPolicy="four_weeks";
msg.measurement="dbwrites";
return msg;

and

temp=msg.payload[0];
msg.payload=[
    {
        value:temp.count
    },
    {
        device:"Raspberry Pi"
    }
];
msg.retentionPolicy="four_weeks";
msg.measurement="dbwrites";
return msg;

Should specify that entering the retention policy and measurement in the influxdb write node works just fine, but I was hoping to have a more generic influxdb write node that I could link multiple functions to, where RP and Measurement were passed in via functions.

@pkkrusty
Copy link
Author

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant